networkd: VXLan TTL must be <= 255
authorSusant Sahani <ssahani@redhat.com>
Mon, 6 May 2019 17:37:32 +0000 (23:07 +0530)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 7 May 2019 18:34:45 +0000 (20:34 +0200)
Ignore when TTL > 255

src/network/netdev/vxlan.c

index 6c18deb..8fa6e87 100644 (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;
 }