[IPV6] address: Convert address deletion to new netlink api
authorThomas Graf <tgraf@suug.ch>
Mon, 18 Sep 2006 07:10:19 +0000 (00:10 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 22:18:56 +0000 (15:18 -0700)
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c

index 52ba96a64a1f6fcb3a1cbb1da21d56872ab3b0f9..61627036eb2bf2fdca5eed28911451633db0ef1a 100644 (file)
@@ -2894,22 +2894,17 @@ static struct nla_policy ifa_ipv6_policy[IFA_MAX+1] __read_mostly = {
 static int
 inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 {
-       struct rtattr **rta = arg;
-       struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
+       struct ifaddrmsg *ifm;
+       struct nlattr *tb[IFA_MAX+1];
        struct in6_addr *pfx;
+       int err;
 
-       pfx = NULL;
-       if (rta[IFA_ADDRESS-1]) {
-               if (RTA_PAYLOAD(rta[IFA_ADDRESS-1]) < sizeof(*pfx))
-                       return -EINVAL;
-               pfx = RTA_DATA(rta[IFA_ADDRESS-1]);
-       }
-       if (rta[IFA_LOCAL-1]) {
-               if (RTA_PAYLOAD(rta[IFA_LOCAL-1]) < sizeof(*pfx) ||
-                   (pfx && memcmp(pfx, RTA_DATA(rta[IFA_LOCAL-1]), sizeof(*pfx))))
-                       return -EINVAL;
-               pfx = RTA_DATA(rta[IFA_LOCAL-1]);
-       }
+       err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy);
+       if (err < 0)
+               return err;
+
+       ifm = nlmsg_data(nlh);
+       pfx = extract_addr(tb[IFA_ADDRESS], tb[IFA_LOCAL]);
        if (pfx == NULL)
                return -EINVAL;
 
This page took 0.02625 seconds and 5 git commands to generate.