networkd: VXLan TTL must be <= 255

Ignore when TTL > 255
This commit is contained in:
Susant Sahani 2019-05-06 23:07:32 +05:30 committed by Zbigniew Jędrzejewski-Szmek
parent 83cb24ac20
commit 76fbd4d73d
1 changed files with 9 additions and 4 deletions

View File

@ -273,10 +273,15 @@ static int netdev_vxlan_verify(NetDev *netdev, const char *filename) {
assert(v);
assert(filename);
if (v->vni > VXLAN_VID_MAX) {
log_warning("VXLAN without valid VNI (or VXLAN Segment ID) configured in %s. Ignoring", filename);
return -EINVAL;
}
if (v->vni > VXLAN_VID_MAX)
return log_netdev_warning_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
"%s: VXLAN without valid VNI (or VXLAN Segment ID) configured. Ignoring.",
filename);
if (v->ttl > 255)
return log_netdev_warning_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
"%s: VXLAN TTL must be <= 255. Ignoring.",
filename);
return 0;
}