netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Haiquan <oc@yunify.com>
To: unlisted-recipients:; (no To-header on input)
Cc: netdev@vger.kernel.org, Chen Haiquan <oc@yunify.com>
Subject: [PATCH] vxlan: Accept user specified MTU value when create new vxlan link
Date: Fri, 27 May 2016 10:49:11 +0800	[thread overview]
Message-ID: <1464317351-22316-1-git-send-email-oc@yunify.com> (raw)

When create a new vxlan link, example:
  ip link add vtap mtu 1440 type vxlan vni 1 dev eth0

The argument "mtu" has no effect, because it is not set to conf->mtu. The
default value is used in vxlan_dev_configure function.

This problem was introduced by commit 0dfbdf4102b9 (vxlan: Factor out device 
configuration).

Fixes: 0dfbdf4102b9 (vxlan: Factor out device configuration) 

Signed-off-by:  Chen Haiquan <oc@yunify.com>
---
 drivers/net/vxlan.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 8ff30c3..f999db2 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -3086,6 +3086,9 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
 	if (data[IFLA_VXLAN_REMCSUM_NOPARTIAL])
 		conf.flags |= VXLAN_F_REMCSUM_NOPARTIAL;
 
+	if (tb[IFLA_MTU])
+		conf.mtu = nla_get_u32(tb[IFLA_MTU]);
+
 	err = vxlan_dev_configure(src_net, dev, &conf);
 	switch (err) {
 	case -ENODEV:
-- 
2.7.4

             reply	other threads:[~2016-05-27  2:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27  2:49 Chen Haiquan [this message]
2016-05-27 16:09 ` [PATCH] vxlan: Accept user specified MTU value when create new vxlan link Cong Wang
2016-05-28 15:22   ` oc
2016-05-31  3:27     ` Cong Wang

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=1464317351-22316-1-git-send-email-oc@yunify.com \
    --to=oc@yunify.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 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).