From: Stephen Hemminger <stephen@networkplumber.org>
To: David Miller <davem@davemloft.net>
Cc: dlstevens@us.ibm.com, amwang@redhat.com, netdev@vger.kernel.org,
netdev-owner@vger.kernel.org
Subject: [PATCH] vxlan: force user to set port value
Date: Wed, 15 May 2013 13:48:18 -0700 [thread overview]
Message-ID: <20130515134818.18b2c710@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20130515.132213.120685330795916926.davem@davemloft.net>
This change shifts burden onto the users to choose the UDP port value.
There is no default value, the destination port must be specified.
This is a migration compromise. The initial development of VXLAN
used UDP port 5287 but now there is an official assigned port for
VXLAN. The kernel can't change because of legacy compatibility
but new deployments should not use the legacy port value.
---
ip/iplink_vxlan.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
index 2d93ee2..263feca 100644
--- a/ip/iplink_vxlan.c
+++ b/ip/iplink_vxlan.c
@@ -53,7 +53,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
__u8 noage = 0;
__u32 age = 0;
__u32 maxaddr = 0;
- __u16 dstport = 4789;
+ __u16 dstport = 0;
+ int dst_port_set = 0;
struct ifla_vxlan_port_range range = { 0, 0 };
while (argc > 0) {
@@ -131,6 +132,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
NEXT_ARG();
if (get_u16(&dstport, *argv, 0))
invarg("dst port", *argv);
+ dst_port_set = 1;
} else if (!matches(*argv, "nolearning")) {
learning = 0;
} else if (!matches(*argv, "learning")) {
@@ -161,10 +163,18 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
}
argc--, argv++;
}
+
if (!vni_set) {
fprintf(stderr, "vxlan: missing virtual network identifier\n");
return -1;
}
+
+ if (!dst_port_set) {
+ fprintf(stderr, "vxlan: destination port not specified\n"
+ "Use 'dstport 4789' to get the IANA assigned value\n");
+ return -1;
+ }
+
addattr32(n, 1024, IFLA_VXLAN_ID, vni);
if (gaddr)
addattr_l(n, 1024, IFLA_VXLAN_GROUP, &gaddr, 4);
@@ -179,6 +189,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
addattr8(n, 1024, IFLA_VXLAN_RSC, rsc);
addattr8(n, 1024, IFLA_VXLAN_L2MISS, l2miss);
addattr8(n, 1024, IFLA_VXLAN_L3MISS, l3miss);
+
if (noage)
addattr32(n, 1024, IFLA_VXLAN_AGEING, 0);
else if (age)
--
1.7.10.4
next prev parent reply other threads:[~2013-05-15 20:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 11:11 [Patch iproute2] vxlan: use 8472 as default dst port Cong Wang
2013-05-15 11:32 ` David Stevens
2013-05-15 16:53 ` Stephen Hemminger
2013-05-15 17:19 ` David Stevens
2013-05-15 17:43 ` Stephen Hemminger
2013-05-15 18:11 ` David Stevens
2013-05-16 8:24 ` David Laight
2013-05-16 16:02 ` Stephen Hemminger
2013-05-15 20:23 ` David Miller
2013-05-15 17:48 ` Stephen Hemminger
2013-05-15 18:42 ` David Stevens
2013-05-15 21:37 ` [RFT] vxlan: listen on multiple ports Stephen Hemminger
2013-05-16 2:51 ` Cong Wang
2013-05-16 6:20 ` Stephen Hemminger
2013-05-15 20:22 ` [Patch iproute2] vxlan: use 8472 as default dst port David Miller
2013-05-15 20:25 ` Stephen Hemminger
2013-05-15 20:48 ` Stephen Hemminger [this message]
2013-05-15 21:47 ` [PATCH] vxlan: force user to set port value David Miller
2013-05-15 22:04 ` Stephen Hemminger
2013-05-15 22:40 ` David Miller
2013-05-15 22:19 ` Stephen Hemminger
2013-05-15 21:57 ` Sridhar Samudrala
2013-05-15 22:01 ` Stephen Hemminger
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=20130515134818.18b2c710@nehalam.linuxnetplumber.net \
--to=stephen@networkplumber.org \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=dlstevens@us.ibm.com \
--cc=netdev-owner@vger.kernel.org \
--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).