networkd: Geneve Allow TTL to be zero.

Also verify VNI is set
This commit is contained in:
Susant Sahani 2019-05-10 15:11:47 +05:30 committed by Yu Watanabe
parent aac350192b
commit 328184d1fc
2 changed files with 8 additions and 6 deletions

View file

@ -713,7 +713,7 @@
<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>
@ -731,7 +731,9 @@
<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>

View 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;
}