diff options
-rw-r--r-- | include/net/netns/ipv6.h | 1 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 1242f371718b..005e2c2e39a9 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
@@ -71,6 +71,7 @@ struct netns_ipv6 { | |||
71 | struct fib_rules_ops *mr6_rules_ops; | 71 | struct fib_rules_ops *mr6_rules_ops; |
72 | #endif | 72 | #endif |
73 | #endif | 73 | #endif |
74 | atomic_t dev_addr_genid; | ||
74 | }; | 75 | }; |
75 | 76 | ||
76 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) | 77 | #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 15794fdaf028..1b9f4f25212e 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -621,6 +621,8 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb, | |||
621 | idx = 0; | 621 | idx = 0; |
622 | head = &net->dev_index_head[h]; | 622 | head = &net->dev_index_head[h]; |
623 | rcu_read_lock(); | 623 | rcu_read_lock(); |
624 | cb->seq = atomic_read(&net->ipv6.dev_addr_genid) ^ | ||
625 | net->dev_base_seq; | ||
624 | hlist_for_each_entry_rcu(dev, head, index_hlist) { | 626 | hlist_for_each_entry_rcu(dev, head, index_hlist) { |
625 | if (idx < s_idx) | 627 | if (idx < s_idx) |
626 | goto cont; | 628 | goto cont; |
@@ -638,6 +640,7 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb, | |||
638 | rcu_read_unlock(); | 640 | rcu_read_unlock(); |
639 | goto done; | 641 | goto done; |
640 | } | 642 | } |
643 | nl_dump_check_consistent(cb, nlmsg_hdr(skb)); | ||
641 | cont: | 644 | cont: |
642 | idx++; | 645 | idx++; |
643 | } | 646 | } |
@@ -3874,6 +3877,7 @@ static int in6_dump_addrs(struct inet6_dev *idev, struct sk_buff *skb, | |||
3874 | NLM_F_MULTI); | 3877 | NLM_F_MULTI); |
3875 | if (err <= 0) | 3878 | if (err <= 0) |
3876 | break; | 3879 | break; |
3880 | nl_dump_check_consistent(cb, nlmsg_hdr(skb)); | ||
3877 | } | 3881 | } |
3878 | break; | 3882 | break; |
3879 | } | 3883 | } |
@@ -3931,6 +3935,7 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb, | |||
3931 | s_ip_idx = ip_idx = cb->args[2]; | 3935 | s_ip_idx = ip_idx = cb->args[2]; |
3932 | 3936 | ||
3933 | rcu_read_lock(); | 3937 | rcu_read_lock(); |
3938 | cb->seq = atomic_read(&net->ipv6.dev_addr_genid) ^ net->dev_base_seq; | ||
3934 | for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) { | 3939 | for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) { |
3935 | idx = 0; | 3940 | idx = 0; |
3936 | head = &net->dev_index_head[h]; | 3941 | head = &net->dev_index_head[h]; |
@@ -4407,6 +4412,8 @@ errout: | |||
4407 | 4412 | ||
4408 | static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | 4413 | static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) |
4409 | { | 4414 | { |
4415 | struct net *net = dev_net(ifp->idev->dev); | ||
4416 | |||
4410 | inet6_ifa_notify(event ? : RTM_NEWADDR, ifp); | 4417 | inet6_ifa_notify(event ? : RTM_NEWADDR, ifp); |
4411 | 4418 | ||
4412 | switch (event) { | 4419 | switch (event) { |
@@ -4432,6 +4439,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | |||
4432 | dst_free(&ifp->rt->dst); | 4439 | dst_free(&ifp->rt->dst); |
4433 | break; | 4440 | break; |
4434 | } | 4441 | } |
4442 | atomic_inc(&net->ipv6.dev_addr_genid); | ||
4435 | } | 4443 | } |
4436 | 4444 | ||
4437 | static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) | 4445 | static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) |