diff --git a/[refs] b/[refs] index 9f5a73c7df81..72479d6c417e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e6d184e33109010412ad1d59719af74755a935f4 +refs/heads/master: a9b1ef8ec7df544b236b19fb6cc42ed2591b65cd diff --git a/trunk/Documentation/networking/ifenslave.c b/trunk/Documentation/networking/ifenslave.c index 545447ac503a..f315d20d3867 100644 --- a/trunk/Documentation/networking/ifenslave.c +++ b/trunk/Documentation/networking/ifenslave.c @@ -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) { @@ -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; diff --git a/trunk/drivers/sbus/char/aurora.c b/trunk/drivers/sbus/char/aurora.c index 672f9f2b2163..92e6c5639dd3 100644 --- a/trunk/drivers/sbus/char/aurora.c +++ b/trunk/drivers/sbus/char/aurora.c @@ -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; @@ -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; @@ -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"); diff --git a/trunk/include/linux/smp.h b/trunk/include/linux/smp.h index b6069c8e1f04..9dfa3ee769ae 100644 --- a/trunk/include/linux/smp.h +++ b/trunk/include/linux/smp.h @@ -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 diff --git a/trunk/include/net/route.h b/trunk/include/net/route.h index e3e5436f8017..dbe79ca67d31 100644 --- a/trunk/include/net/route.h +++ b/trunk/include/net/route.h @@ -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) diff --git a/trunk/net/ipv4/devinet.c b/trunk/net/ipv4/devinet.c index 04a6fe3e95a2..4ec4b2ca6ab1 100644 --- a/trunk/net/ipv4/devinet.c +++ b/trunk/net/ipv4/devinet.c @@ -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(); @@ -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); @@ -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) diff --git a/trunk/net/ipv4/fib_frontend.c b/trunk/net/ipv4/fib_frontend.c index 882f88f6d13b..2267c1fad879 100644 --- a/trunk/net/ipv4/fib_frontend.c +++ b/trunk/net/ipv4/fib_frontend.c @@ -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; diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c b/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c index 6c18a2b6d5ce..de9f4464438d 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c @@ -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; @@ -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); @@ -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; } @@ -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); @@ -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); diff --git a/trunk/net/netlink/af_netlink.c b/trunk/net/netlink/af_netlink.c index 96020d7087e8..8c38ee6d255e 100644 --- a/trunk/net/netlink/af_netlink.c +++ b/trunk/net/netlink/af_netlink.c @@ -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;