]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: Geneve Allow TTL to be zero. 12520/head
authorSusant Sahani <ssahani@gmail.com>
Fri, 10 May 2019 09:41:47 +0000 (15:11 +0530)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 May 2019 13:45:26 +0000 (22:45 +0900)
Also verify VNI is set

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

index 454878d680ef3e43c4b9c2ab35be9ea2e9f749c0..21c7ba827060835521f21e679f4fd75f6295be9f 100644 (file)
       <varlistentry>
         <term><varname>Id=</varname></term>
         <listitem>
-          <para>Specifies the Virtual Network Identifier (VNI) to use. Ranges [0-16777215].</para>
+          <para>Specifies the Virtual Network Identifier (VNI) to use. Ranges [0-16777215]. This field is mandatory.</para>
         </listitem>
       </varlistentry>
       <varlistentry>
       <varlistentry>
         <term><varname>TTL=</varname></term>
         <listitem>
-          <para>Specifies the TTL value to use in outgoing packets. Ranges [1-255].</para>
+          <para>Specifies the TTL value to use in outgoing packets. Takes a number in the range 0-255.
+          When unset or set to 0, the kernel's default will be used meaning that packets TTL will be set from
+          <filename>/proc/sys/net/ipv4/ip_default_ttl</filename>.</para>
         </listitem>
       </varlistentry>
       <varlistentry>
index fee596e582c0b5b71dbe67fe3a0935e97e1b03b2..1b1cd2fc9e4e9ac0c48068772b88674c9dda9691 100644 (file)
@@ -278,10 +278,10 @@ static int netdev_geneve_verify(NetDev *netdev, const char *filename) {
         assert(v);
         assert(filename);
 
-        if (v->ttl == 0) {
-                log_warning("Invalid Geneve TTL value '0' configured in '%s'. Ignoring", filename);
-                return -EINVAL;
-        }
+        if (v->id > GENEVE_VID_MAX)
+                return log_netdev_warning_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
+                                                "%s: Geneve without valid VNI (or Virtual Network Identifier) configured. Ignoring.",
+                                                filename);
 
         return 0;
 }