aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/addrconf.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 52ba96a64a1f..61627036eb2b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2894,22 +2894,17 @@ static struct nla_policy ifa_ipv6_policy[IFA_MAX+1] __read_mostly = {
2894static int 2894static int
2895inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) 2895inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
2896{ 2896{
2897 struct rtattr **rta = arg; 2897 struct ifaddrmsg *ifm;
2898 struct ifaddrmsg *ifm = NLMSG_DATA(nlh); 2898 struct nlattr *tb[IFA_MAX+1];
2899 struct in6_addr *pfx; 2899 struct in6_addr *pfx;
2900 int err;
2900 2901
2901 pfx = NULL; 2902 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy);
2902 if (rta[IFA_ADDRESS-1]) { 2903 if (err < 0)
2903 if (RTA_PAYLOAD(rta[IFA_ADDRESS-1]) < sizeof(*pfx)) 2904 return err;
2904 return -EINVAL; 2905
2905 pfx = RTA_DATA(rta[IFA_ADDRESS-1]); 2906 ifm = nlmsg_data(nlh);
2906 } 2907 pfx = extract_addr(tb[IFA_ADDRESS], tb[IFA_LOCAL]);
2907 if (rta[IFA_LOCAL-1]) {
2908 if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*pfx) ||
2909 (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))))
2910 return -EINVAL;
2911 pfx = RTA_DATA(rta[IFA_LOCAL-1]);
2912 }
2913 if (pfx == NULL) 2908 if (pfx == NULL)
2914 return -EINVAL; 2909 return -EINVAL;
2915 2910