netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladislav Yasevich <vyasevich@gmail.com>
To: netdev@vger.kernel.org
Cc: girish.moodalbail@oracle.com, Vladislav Yasevich <vyasevic@redhat.com>
Subject: [PATCH V2 net 2/4] macvlan: Fix passthru macvlan mac address inheritance
Date: Wed, 21 Jun 2017 07:59:17 -0400	[thread overview]
Message-ID: <20170621115919.28165-3-vyasevic@redhat.com> (raw)
In-Reply-To: <20170621115919.28165-1-vyasevic@redhat.com>

When a lower device of the passthru macvlan changes it's address,
passthru macvlan is supposed to change it's own address as well.
However, that doesn't happen correctly because the check in
macvlan_addr_busy() will catch the fact that the lower level
(port) mac address is the same as the address we are trying to
assign to the macvlan, and return an error.  As a reasult,
the address of the passthru macvlan device is never changed.

The same thing happens when the user attempts to change the
mac address of the passthru macvlan.

The simple solution appers to be to not check against
the lower device in case of passthru macvlan device, since
the 2 addresses are _supposed_ to be the same.

Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
 drivers/net/macvlan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index de214fb..0c9c6da 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -185,7 +185,8 @@ static bool macvlan_addr_busy(const struct macvlan_port *port,
 	 * currently in use by the underlying device or
 	 * another macvlan.
 	 */
-	if (ether_addr_equal_64bits(port->dev->dev_addr, addr))
+	if (!port->passthru &&
+	    ether_addr_equal_64bits(port->dev->dev_addr, addr))
 		return true;
 
 	if (macvlan_hash_lookup(port, addr))
-- 
2.9.4

  parent reply	other threads:[~2017-06-21 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21 11:59 [PATCH V2 net 0/4] macvlan: Fix some issues with changing mac addresses Vladislav Yasevich
2017-06-21 11:59 ` [PATCH V2 net 1/4] macvlan: Do not return error when setting the same mac address Vladislav Yasevich
2017-06-21 11:59 ` Vladislav Yasevich [this message]
2017-06-21 11:59 ` [PATCH V2 net 3/4] macvlan: convert port passthru to flags Vladislav Yasevich
2017-06-21 11:59 ` [PATCH V2 net 4/4] macvlan: Let passthru macvlan correctly restore lower mac address Vladislav Yasevich
2017-06-22 15:17 ` [PATCH V2 net 0/4] macvlan: Fix some issues with changing mac addresses 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=20170621115919.28165-3-vyasevic@redhat.com \
    --to=vyasevich@gmail.com \
    --cc=girish.moodalbail@oracle.com \
    --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).