[IPV6] address: Convert address deletion to new netlink api
Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
461d8837fa
commit
b933f7166b
|
@ -2894,22 +2894,17 @@ static struct nla_policy ifa_ipv6_policy[IFA_MAX+1] __read_mostly = {
|
||||||
static int
|
static int
|
||||||
inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
|
inet6_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
|
||||||
{
|
{
|
||||||
struct rtattr **rta = arg;
|
struct ifaddrmsg *ifm;
|
||||||
struct ifaddrmsg *ifm = NLMSG_DATA(nlh);
|
struct nlattr *tb[IFA_MAX+1];
|
||||||
struct in6_addr *pfx;
|
struct in6_addr *pfx;
|
||||||
|
int err;
|
||||||
|
|
||||||
pfx = NULL;
|
err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy);
|
||||||
if (rta[IFA_ADDRESS-1]) {
|
if (err < 0)
|
||||||
if (RTA_PAYLOAD(rta[IFA_ADDRESS-1]) < sizeof(*pfx))
|
return err;
|
||||||
return -EINVAL;
|
|
||||||
pfx = RTA_DATA(rta[IFA_ADDRESS-1]);
|
ifm = nlmsg_data(nlh);
|
||||||
}
|
pfx = extract_addr(tb[IFA_ADDRESS], tb[IFA_LOCAL]);
|
||||||
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]);
|
|
||||||
}
|
|
||||||
if (pfx == NULL)
|
if (pfx == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue