netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/2] macvlan: propogate mtu changes
Date: Wed, 29 Oct 2008 12:59:12 -0700	[thread overview]
Message-ID: <20081029125912.002dbe9d@extreme> (raw)
In-Reply-To: <20081029125343.695eeb3c@extreme>

If MTU of underlying real device is changed, propogate up to macvlan
pseudo devices.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/drivers/net/macvlan.c	2008-10-29 09:53:00.000000000 -0700
+++ b/drivers/net/macvlan.c	2008-10-29 12:58:40.000000000 -0700
@@ -537,6 +537,19 @@ static int macvlan_device_event(struct n
 		list_for_each_entry_safe(vlan, next, &port->vlans, list)
 			macvlan_dellink(vlan->dev);
 		break;
+	case NETDEV_CHANGEMTU:
+		list_for_each_entry(vlan, &port->vlans, list) {
+			int err, oldmtu = vlan->dev->mtu;
+
+			err = dev_set_mtu(vlan->dev, dev->mtu);
+			if (err) {
+				list_for_each_entry_continue_reverse(vlan,
+								     &port->vlans,
+								     list)
+					dev_set_mtu(vlan->dev, oldmtu);
+				return notifier_from_errno(err);
+			}
+		}
 	}
 	return NOTIFY_DONE;
 }

  reply	other threads:[~2008-10-29 19:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29 19:53 [PATCH 1/2] macvlan: add support for ethtool get settings Stephen Hemminger
2008-10-29 19:59 ` Stephen Hemminger [this message]
2008-10-29 21:02   ` [PATCH 2/2] macvlan: propogate mtu changes Patrick McHardy
2008-10-29 21:05     ` Patrick McHardy
2008-10-29 21:05       ` David Miller
2008-10-29 21:06         ` Patrick McHardy
2008-10-29 21:01 ` [PATCH 1/2] macvlan: add support for ethtool get settings Patrick McHardy
2008-10-29 22:32   ` 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=20081029125912.002dbe9d@extreme \
    --to=shemminger@vyatta.com \
    --cc=kaber@trash.net \
    --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 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).