Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14636
b: refs/heads/master
c: a9b1ef8
h: refs/heads/master
v: v3
  • Loading branch information
Adrian Bunk authored and David S. Miller committed Nov 22, 2005
1 parent bcfb347 commit 0e59967
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e6d184e33109010412ad1d59719af74755a935f4
refs/heads/master: a9b1ef8ec7df544b236b19fb6cc42ed2591b65cd
9 changes: 8 additions & 1 deletion trunk/Documentation/networking/ifenslave.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,13 @@ static int enslave(char *master_ifname, char *slave_ifname)
/* Older bonding versions would panic if the slave has no IP
* address, so get the IP setting from the master.
*/
set_if_addr(master_ifname, slave_ifname);
res = set_if_addr(master_ifname, slave_ifname);
if (res) {
fprintf(stderr,
"Slave '%s': Error: set address failed\n",
slave_ifname);
return res;
}
} else {
res = clear_if_addr(slave_ifname);
if (res) {
Expand Down Expand Up @@ -1079,6 +1085,7 @@ static int set_if_addr(char *master_ifname, char *slave_ifname)
slave_ifname, ifra[i].req_name,
strerror(saved_errno));

return res;
}

ipaddr = ifr.ifr_addr.sa_data;
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/sbus/char/aurora.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,25 @@ static inline int aurora_paranoia_check(struct Aurora_port const * port,
*/

/* Get board number from pointer */
extern inline int board_No (struct Aurora_board const * bp)
static inline int board_No (struct Aurora_board const * bp)
{
return bp - aurora_board;
}

/* Get port number from pointer */
extern inline int port_No (struct Aurora_port const * port)
static inline int port_No (struct Aurora_port const * port)
{
return AURORA_PORT(port - aurora_port);
}

/* Get pointer to board from pointer to port */
extern inline struct Aurora_board * port_Board(struct Aurora_port const * port)
static inline struct Aurora_board * port_Board(struct Aurora_port const * port)
{
return &aurora_board[AURORA_BOARD(port - aurora_port)];
}

/* Wait for Channel Command Register ready */
extern inline void aurora_wait_CCR(struct aurora_reg128 * r)
static inline void aurora_wait_CCR(struct aurora_reg128 * r)
{
unsigned long delay;

Expand All @@ -161,7 +161,7 @@ printk("aurora_wait_CCR\n");
*/

/* Must be called with enabled interrupts */
extern inline void aurora_long_delay(unsigned long delay)
static inline void aurora_long_delay(unsigned long delay)
{
unsigned long i;

Expand Down Expand Up @@ -420,7 +420,7 @@ static void aurora_release_io_range(struct Aurora_board *bp)
sbus_iounmap((unsigned long)bp->r3, 4);
}

extern inline void aurora_mark_event(struct Aurora_port * port, int event)
static inline void aurora_mark_event(struct Aurora_port * port, int event)
{
#ifdef AURORA_DEBUG
printk("aurora_mark_event: start\n");
Expand Down
8 changes: 1 addition & 7 deletions trunk/include/linux/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,7 @@ void smp_prepare_boot_cpu(void);
*/
#define raw_smp_processor_id() 0
#define hard_smp_processor_id() 0

static inline int smp_call_function(void (*func) (void *info), void *info,
int retry, int wait)
{
return 0;
}

#define smp_call_function(func,info,retry,wait) ({ 0; })
#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; })
static inline void smp_send_reschedule(int cpu) { }
#define num_booting_cpus() 1
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/net/route.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ extern int ip_rt_ioctl(unsigned int cmd, void __user *arg);
extern void ip_rt_get_source(u8 *src, struct rtable *rt);
extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb);

struct in_ifaddr;
extern void fib_add_ifaddr(struct in_ifaddr *);

static inline void ip_rt_put(struct rtable * rt)
{
if (rt)
Expand Down
40 changes: 10 additions & 30 deletions trunk/net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
int destroy)
{
struct in_ifaddr *promote = NULL;
struct in_ifaddr *ifa, *ifa1 = *ifap;
struct in_ifaddr *last_prim = in_dev->ifa_list;
struct in_ifaddr *prev_prom = NULL;
int do_promote = IN_DEV_PROMOTE_SECONDARIES(in_dev);
struct in_ifaddr *ifa1 = *ifap;

ASSERT_RTNL();

Expand All @@ -246,22 +243,18 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
**/

if (!(ifa1->ifa_flags & IFA_F_SECONDARY)) {
struct in_ifaddr *ifa;
struct in_ifaddr **ifap1 = &ifa1->ifa_next;

while ((ifa = *ifap1) != NULL) {
if (!(ifa->ifa_flags & IFA_F_SECONDARY) &&
ifa1->ifa_scope <= ifa->ifa_scope)
last_prim = ifa;

if (!(ifa->ifa_flags & IFA_F_SECONDARY) ||
ifa1->ifa_mask != ifa->ifa_mask ||
!inet_ifa_match(ifa1->ifa_address, ifa)) {
ifap1 = &ifa->ifa_next;
prev_prom = ifa;
continue;
}

if (!do_promote) {
if (!IN_DEV_PROMOTE_SECONDARIES(in_dev)) {
*ifap1 = ifa->ifa_next;

rtmsg_ifa(RTM_DELADDR, ifa);
Expand Down Expand Up @@ -290,32 +283,19 @@ static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
*/
rtmsg_ifa(RTM_DELADDR, ifa1);
notifier_call_chain(&inetaddr_chain, NETDEV_DOWN, ifa1);

if (promote) {

if (prev_prom) {
prev_prom->ifa_next = promote->ifa_next;
promote->ifa_next = last_prim->ifa_next;
last_prim->ifa_next = promote;
}

promote->ifa_flags &= ~IFA_F_SECONDARY;
rtmsg_ifa(RTM_NEWADDR, promote);
notifier_call_chain(&inetaddr_chain, NETDEV_UP, promote);
for (ifa = promote->ifa_next; ifa; ifa = ifa->ifa_next) {
if (ifa1->ifa_mask != ifa->ifa_mask ||
!inet_ifa_match(ifa1->ifa_address, ifa))
continue;
fib_add_ifaddr(ifa);
}

}
if (destroy) {
inet_free_ifa(ifa1);

if (!in_dev->ifa_list)
inetdev_destroy(in_dev);
}

if (promote && IN_DEV_PROMOTE_SECONDARIES(in_dev)) {
/* not sure if we should send a delete notify first? */
promote->ifa_flags &= ~IFA_F_SECONDARY;
rtmsg_ifa(RTM_NEWADDR, promote);
notifier_call_chain(&inetaddr_chain, NETDEV_UP, promote);
}
}

static int inet_insert_ifa(struct in_ifaddr *ifa)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static void fib_magic(int cmd, int type, u32 dst, int dst_len, struct in_ifaddr
tb->tb_delete(tb, &req.rtm, &rta, &req.nlh, NULL);
}

void fib_add_ifaddr(struct in_ifaddr *ifa)
static void fib_add_ifaddr(struct in_ifaddr *ifa)
{
struct in_device *in_dev = ifa->ifa_dev;
struct net_device *dev = in_dev->dev;
Expand Down
24 changes: 12 additions & 12 deletions trunk/net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ ctnetlink_dump_tuples_proto(struct sk_buff *skb,

NFA_PUT(skb, CTA_PROTO_NUM, sizeof(u_int8_t), &tuple->dst.protonum);

/* If no protocol helper is found, this function will return the
* generic protocol helper, so proto won't *ever* be NULL */
proto = ip_conntrack_proto_find_get(tuple->dst.protonum);
if (likely(proto->tuple_to_nfattr))
if (likely(proto && proto->tuple_to_nfattr)) {
ret = proto->tuple_to_nfattr(skb, tuple);

ip_conntrack_proto_put(proto);
ip_conntrack_proto_put(proto);
}

return ret;

Expand Down Expand Up @@ -130,11 +128,9 @@ ctnetlink_dump_protoinfo(struct sk_buff *skb, const struct ip_conntrack *ct)

struct nfattr *nest_proto;
int ret;

if (!proto->to_nfattr) {
ip_conntrack_proto_put(proto);

if (!proto || !proto->to_nfattr)
return 0;
}

nest_proto = NFA_NEST(skb, CTA_PROTOINFO);

Expand Down Expand Up @@ -531,10 +527,10 @@ ctnetlink_parse_tuple_proto(struct nfattr *attr,

proto = ip_conntrack_proto_find_get(tuple->dst.protonum);

if (likely(proto->nfattr_to_tuple))
if (likely(proto && proto->nfattr_to_tuple)) {
ret = proto->nfattr_to_tuple(tb, tuple);

ip_conntrack_proto_put(proto);
ip_conntrack_proto_put(proto);
}

return ret;
}
Expand Down Expand Up @@ -600,6 +596,8 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr,
return -EINVAL;

npt = ip_nat_proto_find_get(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum);
if (!npt)
return 0;

if (!npt->nfattr_to_range) {
ip_nat_proto_put(npt);
Expand Down Expand Up @@ -959,6 +957,8 @@ ctnetlink_change_protoinfo(struct ip_conntrack *ct, struct nfattr *cda[])
nfattr_parse_nested(tb, CTA_PROTOINFO_MAX, attr);

proto = ip_conntrack_proto_find_get(npt);
if (!proto)
return -EINVAL;

if (proto->from_nfattr)
err = proto->from_nfattr(tb, ct);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static int netlink_autobind(struct socket *sock)
struct hlist_head *head;
struct sock *osk;
struct hlist_node *node;
s32 pid = current->tgid;
s32 pid = current->pid;
int err;
static s32 rover = -4097;

Expand Down

0 comments on commit 0e59967

Please sign in to comment.