From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, eric.dumazet@gmail.com, timo.teras@iki.fi,
	kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org,
	kaber@trash.net, bhutchings@solarflare.com,
	xiyou.wangcong@gmail.com
Subject: [patch net-next v3 3/3] arp: flush arp cache on IFF_NOARP change
Date: Tue, 28 May 2013 13:30:23 +0200	[thread overview]
Message-ID: <1369740623-17601-4-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1369740623-17601-1-git-send-email-jiri@resnulli.us>
From: Timo Teräs <timo.teras@iki.fi>
IFF_NOARP affects what kind of neighbor entries are created
(nud NOARP or nud INCOMPLETE). If the flag changes, flush the arp
cache to refresh all entries.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
v2->v3: shortened notifier_info struct name
---
 net/ipv4/arp.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index bf57402..4429b01 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1235,12 +1235,18 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event,
 			    void *ptr)
 {
 	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
+	struct netdev_notifier_change_info *change_info;
 
 	switch (event) {
 	case NETDEV_CHANGEADDR:
 		neigh_changeaddr(&arp_tbl, dev);
 		rt_cache_flush(dev_net(dev));
 		break;
+	case NETDEV_CHANGE:
+		change_info = ptr;
+		if (change_info->flags_changed & IFF_NOARP)
+			neigh_changeaddr(&arp_tbl, dev);
+		break;
 	default:
 		break;
 	}
-- 
1.7.11.7
next prev parent reply	other threads:[~2013-05-28 11:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 11:30 [patch net-next v3 0/3] net: extend netdevice notifier and use it for flags change Jiri Pirko
2013-05-28 11:30 ` [patch net-next v3 1/3] net: pass info struct via netdevice notifier Jiri Pirko
2013-05-28 11:30 ` [patch net-next v3 2/3] net: pass changed flags along with NETDEV_CHANGE event Jiri Pirko
2013-05-28 11:30 ` Jiri Pirko [this message]
2013-05-28 20:11 ` [patch net-next v3 0/3] net: extend netdevice notifier and use it for flags change 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=1369740623-17601-4-git-send-email-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=timo.teras@iki.fi \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yoshfuji@linux-ipv6.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).