X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Fdevinet.c;h=ec968e4b80482d3c908e4af6f7d9f4a83b7e50c5;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=cc5dd5637563106f2cb35f7f0d744715f34c4cc2;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index cc5dd5637..ec968e4b8 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include @@ -158,8 +158,7 @@ struct in_device *inetdev_init(struct net_device *dev) /* Account for reference dev->ip_ptr */ in_dev_hold(in_dev); - smp_wmb(); - dev->ip_ptr = in_dev; + rcu_assign_pointer(dev->ip_ptr, in_dev); #ifdef CONFIG_SYSCTL devinet_sysctl_register(in_dev, &in_dev->cnf); @@ -381,7 +380,7 @@ struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, return NULL; } -int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct rtattr **rta = arg; struct in_device *in_dev; @@ -400,7 +399,7 @@ int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) memcmp(RTA_DATA(rta[IFA_LOCAL - 1]), &ifa->ifa_local, 4)) || (rta[IFA_LABEL - 1] && - strcmp(RTA_DATA(rta[IFA_LABEL - 1]), ifa->ifa_label)) || + rtattr_strcmp(rta[IFA_LABEL - 1], ifa->ifa_label)) || (rta[IFA_ADDRESS - 1] && (ifm->ifa_prefixlen != ifa->ifa_prefixlen || !inet_ifa_match(*(u32*)RTA_DATA(rta[IFA_ADDRESS - 1]), @@ -413,7 +412,7 @@ out: return -EADDRNOTAVAIL; } -int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct rtattr **rta = arg; struct net_device *dev; @@ -457,7 +456,7 @@ int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) in_dev_hold(in_dev); ifa->ifa_dev = in_dev; if (rta[IFA_LABEL - 1]) - memcpy(ifa->ifa_label, RTA_DATA(rta[IFA_LABEL - 1]), IFNAMSIZ); + rtattr_strlcpy(ifa->ifa_label, rta[IFA_LABEL - 1], IFNAMSIZ); else memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);