From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
junwei.zhang@6wind.com, hongjun.li@6wind.com
Subject: Re: [PATCH net-next 2/2] ipv6: provide addr and netconf dump consistency info
Date: Fri, 22 Mar 2013 17:22:49 +0100 [thread overview]
Message-ID: <514C8559.5030301@6wind.com> (raw)
In-Reply-To: <1363963360-3603-2-git-send-email-nicolas.dichtel@6wind.com>
Please, drop both patches. If we dump addresses via rtnl_dump_all(), seq is not
reset and thus NLM_F_DUMP_INTR is always set when switching from ipv4 to ipv6
family.
I will send a new patch.
Nicolas
Le 22/03/2013 15:42, Nicolas Dichtel a écrit :
> This patch adds a dev_addr_genid for IPv6. The goal is to use it, combined with
> dev_base_seq to check if a change occurs during a netlink dump.
> If a change is detected, the flag NLM_F_DUMP_INTR is set in the first message
> after the dump was interrupted.
>
> Note that only dump of unicast addresses is checked (multicast and anycast are
> not checked).
>
> Reported-by: Junwei Zhang <junwei.zhang@6wind.com>
> Reported-by: Hongjun Li <hongjun.li@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
> include/net/netns/ipv6.h | 1 +
> net/ipv6/addrconf.c | 8 ++++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
> index 1242f37..005e2c2 100644
> --- a/include/net/netns/ipv6.h
> +++ b/include/net/netns/ipv6.h
> @@ -71,6 +71,7 @@ struct netns_ipv6 {
> struct fib_rules_ops *mr6_rules_ops;
> #endif
> #endif
> + atomic_t dev_addr_genid;
> };
>
> #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index fa36a67..d0e40d4 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -622,6 +622,8 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb,
> idx = 0;
> head = &net->dev_index_head[h];
> rcu_read_lock();
> + cb->seq = atomic_read(&net->ipv6.dev_addr_genid) ^
> + net->dev_base_seq;
> hlist_for_each_entry_rcu(dev, head, index_hlist) {
> if (idx < s_idx)
> goto cont;
> @@ -639,6 +641,7 @@ static int inet6_netconf_dump_devconf(struct sk_buff *skb,
> rcu_read_unlock();
> goto done;
> }
> + nl_dump_check_consistent(cb, nlmsg_hdr(skb));
> cont:
> idx++;
> }
> @@ -3875,6 +3878,7 @@ static int in6_dump_addrs(struct inet6_dev *idev, struct sk_buff *skb,
> NLM_F_MULTI);
> if (err <= 0)
> break;
> + nl_dump_check_consistent(cb, nlmsg_hdr(skb));
> }
> break;
> }
> @@ -3932,6 +3936,7 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
> s_ip_idx = ip_idx = cb->args[2];
>
> rcu_read_lock();
> + cb->seq = atomic_read(&net->ipv6.dev_addr_genid) ^ net->dev_base_seq;
> for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) {
> idx = 0;
> head = &net->dev_index_head[h];
> @@ -4409,6 +4414,8 @@ errout:
>
> static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
> {
> + struct net *net = dev_net(ifp->idev->dev);
> +
> inet6_ifa_notify(event ? : RTM_NEWADDR, ifp);
>
> switch (event) {
> @@ -4434,6 +4441,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
> dst_free(&ifp->rt->dst);
> break;
> }
> + atomic_inc(&net->ipv6.dev_addr_genid);
> }
>
> static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
>
--
Nicolas DICHTEL
6WIND
R&D Engineer
Tel: +33 1 39 30 92 41
Fax: +33 1 39 30 92 11
nicolas.dichtel@6wind.com
www.6wind.com
www.6windblog.com
Twitter: http://twitter.com/6windsoftware
Ce courriel ainsi que toutes les pièces jointes, est uniquement destiné à son ou
ses destinataires. Il contient des informations confidentielles qui sont la
propriété de 6WIND. Toute révélation, distribution ou copie des informations
qu'il contient est strictement interdite. Si vous avez reçu ce message par
erreur, veuillez immédiatement le signaler à l'émetteur et détruire toutes les
données reçues.
This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and contains information that is confidential and
proprietary to 6WIND. All unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message.
next prev parent reply other threads:[~2013-03-22 16:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 14:42 [PATCH net-next 1/2] ipv4: provide addr and netconf dump consistency info Nicolas Dichtel
2013-03-22 14:42 ` [PATCH net-next 2/2] ipv6: " Nicolas Dichtel
2013-03-22 16:22 ` Nicolas Dichtel [this message]
2013-03-22 16:28 ` [PATCH net-next v2 1/2] ipv4: " Nicolas Dichtel
2013-03-22 16:28 ` [PATCH net-next v2 2/2] ipv6: " Nicolas Dichtel
2013-03-24 21:16 ` [PATCH net-next v2 1/2] ipv4: " David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-03-22 14:45 [PATCH iproute2] libnetlink: check flag NLM_F_DUMP_INTR during dumps Nicolas Dichtel
2013-03-22 14:59 ` Eric Dumazet
2013-03-22 15:03 ` Nicolas Dichtel
2013-03-22 15:14 ` Eric Dumazet
2013-03-22 15:22 ` Thomas Graf
2013-03-22 15:42 ` [PATCH iproute2 v2] " Nicolas Dichtel
2013-03-22 15:49 ` Eric Dumazet
2013-03-22 16:34 ` [PATCH iproute2 v3] " Nicolas Dichtel
2013-03-24 21:17 ` [PATCH net-next v2 2/2] ipv6: provide addr and netconf dump consistency info David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=514C8559.5030301@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=hongjun.li@6wind.com \
--cc=junwei.zhang@6wind.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.