diff options
author | Kyle Mestery <kmestery@cisco.com> | 2013-02-28 09:30:16 -0500 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2013-02-28 09:19:52 -0800 |
commit | 9eeb949bbaf75565ab2330ea26ae467d87ec194d (patch) | |
tree | 6b302140b2a375f415e0a4de1f60cba8d4c51340 /lib/netdev-vport.c | |
parent | f231418e8b95f3a0baf930dee587a2bb271ae196 (diff) | |
download | openvswitch-9eeb949bbaf75565ab2330ea26ae467d87ec194d.tar.gz |
tunnel: Only print non-default UDP dst_port for LISP/VXLAN tunnels
In get_tunnel_config(), distinguish between VXLAN and LISP when deciding
whether or not to print UDP destination port. Only add the UDP
destination port for either protocol if it is not the default UDP port.
Update the LISP unit test to match the new behavior as well.
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
[jesse: merge common test for VXLAN and LISP]
Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'lib/netdev-vport.c')
-rw-r--r-- | lib/netdev-vport.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index d696404ef..adcc3529f 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -521,7 +521,10 @@ get_tunnel_config(struct netdev_dev *dev, struct smap *args) if (tnl_cfg->dst_port) { uint16_t dst_port = ntohs(tnl_cfg->dst_port); - if (dst_port != VXLAN_DST_PORT) { + const char *type = netdev_dev_get_type(dev); + + if ((!strcmp("vxlan", type) && dst_port != VXLAN_DST_PORT) || + (!strcmp("lisp", type) && dst_port != LISP_DST_PORT)) { smap_add_format(args, "dst_port", "%d", dst_port); } } |