From: Mike Manning <mmanning@brocade.com>
To: <netdev@vger.kernel.org>
Subject: [PATCH net] vlan: Propagate MAC address changes properly
Date: Sat, 30 Apr 2016 11:32:37 +0100 [thread overview]
Message-ID: <572489C5.3020502@brocade.com> (raw)
In-Reply-To: <5723D930.6040004@brocade.com>
The MAC address of the physical interface is only copied to the VLAN
when it is first created, resulting in an inconsistency after MAC
address changes of only newly created VLANs having an up-to-date MAC.
Continuing to inherit the MAC address unless explicitly changed for
the VLAN allows IPv6 EUI64 addresses for the VLAN to reflect the change
and thus for DAD to behave as expected for the given MAC.
Signed-off-by: Mike Manning <mmanning@brocade.com>
---
net/8021q/vlan.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index d2cd9de..2f57cf2 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -293,15 +293,15 @@ static void vlan_sync_address(struct net_device *dev,
/* vlan address was different from the old address and is equal to
* the new address */
- if (!ether_addr_equal(vlandev->dev_addr, vlan->real_dev_addr) &&
+ if ((vlandev->flags & IFF_UP) &&
+ !ether_addr_equal(vlandev->dev_addr, vlan->real_dev_addr) &&
ether_addr_equal(vlandev->dev_addr, dev->dev_addr))
dev_uc_del(dev, vlandev->dev_addr);
- /* vlan address was equal to the old address and is different from
+ /* vlan address was equal to the old address so now also inherit
* the new address */
- if (ether_addr_equal(vlandev->dev_addr, vlan->real_dev_addr) &&
- !ether_addr_equal(vlandev->dev_addr, dev->dev_addr))
- dev_uc_add(dev, vlandev->dev_addr);
+ if (ether_addr_equal(vlandev->dev_addr, vlan->real_dev_addr))
+ ether_addr_copy(vlandev->dev_addr, dev->dev_addr);
ether_addr_copy(vlan->real_dev_addr, dev->dev_addr);
}
@@ -389,13 +389,8 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
case NETDEV_CHANGEADDR:
/* Adjust unicast filters on underlying device */
- vlan_group_for_each_dev(grp, i, vlandev) {
- flgs = vlandev->flags;
- if (!(flgs & IFF_UP))
- continue;
-
+ vlan_group_for_each_dev(grp, i, vlandev)
vlan_sync_address(dev, vlandev);
- }
break;
case NETDEV_CHANGEMTU:
--
1.7.10.4
next parent reply other threads:[~2016-04-30 10:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5723D930.6040004@brocade.com>
2016-04-30 10:32 ` Mike Manning [this message]
2016-05-03 4:16 ` [PATCH net] vlan: Propagate MAC address changes properly David Miller
2016-05-03 15:18 ` Mike Manning
2016-05-03 16:34 ` 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=572489C5.3020502@brocade.com \
--to=mmanning@brocade.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.