]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: Assign VXLAN destination port to when GPE is set
authorSusant Sahani <ssahani@gmail.com>
Wed, 8 May 2019 14:39:42 +0000 (20:09 +0530)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 9 May 2019 04:40:33 +0000 (06:40 +0200)
When VXLAN destination port is unset and GPE is set
then assign 4790 to destination port. Kernel does the same as
well as iproute.

IANA VXLAN-GPE port is 4790

man/systemd.netdev.xml
src/network/netdev/vxlan.c

index 7fddedf6e8ff7aebe851d3d1690b5c9e4c320ef9..fc33f89a3883cdf186de82eb46c3951c39fb247a 100644 (file)
          <para>Takes a boolean. When true, Generic Protocol Extension extends the existing VXLAN protocol
          to provide protocol typing, OAM, and versioning capabilities. For details about the VXLAN GPE
          Header, see the <ulink url="https://tools.ietf.org/html/draft-ietf-nvo3-vxlan-gpe-07">
-         Generic Protocol Extension for VXLAN </ulink> document. Defaults to false.</para>
+         Generic Protocol Extension for VXLAN </ulink> document. If destination port is not specified and
+         Generic Protocol Extension is set then default port of 4790 is used. Defaults to false.</para>
        </listitem>
     </varlistentry>
     <varlistentry>
index 86403696a01ed1e64511ec291a662397b927f02c..56c97cb6865e6c7e1a6fecde8e5867648ea265e8 100644 (file)
@@ -289,6 +289,9 @@ static int netdev_vxlan_verify(NetDev *netdev, const char *filename) {
                                                 "%s: VXLAN TTL must be <= 255. Ignoring.",
                                                 filename);
 
+        if (!v->dest_port && v->generic_protocol_extension)
+                v->dest_port = 4790;
+
         return 0;
 }