From: Ding Tianhong <dingtianhong@huawei.com>
To: <kaber@trash.net>, <davem@davemloft.net>, <edumazet@google.com>,
<vyasevic@redhat.com>, <makita.toshiaki@lab.ntt.co.jp>
Cc: <netdev@vger.kernel.org>
Subject: [PATCH net-next v2 3/3] macvlan: don't set the same mac address for non-passthru mode
Date: Thu, 5 Jun 2014 20:01:03 +0800 [thread overview]
Message-ID: <1401969663-4464-4-git-send-email-dingtianhong@huawei.com> (raw)
In-Reply-To: <1401969663-4464-1-git-send-email-dingtianhong@huawei.com>
The macvlan should have the same mac address only for passthru mode,
so the underlying device couldn't set a new address if it is in use
by macvlan for non-passthru mode, otherwise it will break the work
mechanism.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
drivers/net/macvlan.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index c3a54a6..edf1a1c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1185,8 +1185,12 @@ static int macvlan_device_event(struct notifier_block *unused,
}
break;
case NETDEV_CHANGEADDR:
- if (!port->passthru)
+ if (!port->passthru) {
+ if (macvlan_hash_lookup(port, dev->dev_addr))
+ return NOTIFY_BAD;
+
return NOTIFY_DONE;
+ }
vlan = list_first_entry_or_null(&port->vlans,
struct macvlan_dev,
--
1.8.0
prev parent reply other threads:[~2014-06-05 12:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 12:01 [PATCH net-next v2 0/3] macvlan: fix some problem if mac address changes Ding Tianhong
2014-06-05 12:01 ` [PATCH net-next v2 1/3] macvlan: don't update the uc and vlan list for L2 forwarding offload Ding Tianhong
2014-06-05 15:09 ` Vlad Yasevich
2014-06-06 1:42 ` Ding Tianhong
2014-06-06 3:45 ` Ding Tianhong
2014-06-06 17:11 ` Vlad Yasevich
2014-06-07 5:59 ` Ding Tianhong
2014-06-05 12:01 ` [PATCH net-next v2 2/3] net: dev: revert the mac address when notifier failed Ding Tianhong
2014-06-05 12:01 ` Ding Tianhong [this message]
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=1401969663-4464-4-git-send-email-dingtianhong@huawei.com \
--to=dingtianhong@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kaber@trash.net \
--cc=makita.toshiaki@lab.ntt.co.jp \
--cc=netdev@vger.kernel.org \
--cc=vyasevic@redhat.com \
/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).