From: Christos Sfakianakis <csfakian(a)redhat.com>
Add logging messages for cases when a multicast IP is used in error
in place of a unicast one and vice-versa.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Devices/VxlanDevice.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lnst/Devices/VxlanDevice.py b/lnst/Devices/VxlanDevice.py
index bab5d4c..9e95743 100644
--- a/lnst/Devices/VxlanDevice.py
+++ b/lnst/Devices/VxlanDevice.py
@@ -11,6 +11,7 @@ olichtne(a)redhat.com (Ondrej Lichtner)
"""
import pyroute2
+import logging
from lnst.Common.Logs import log_exc_traceback
from lnst.Common.DeviceError import DeviceError, DeviceConfigError
from lnst.Common.IpAddress import ipaddress
@@ -30,6 +31,12 @@ class VxlanDevice(SoftDevice):
if "group" not in kwargs and "remote" not in kwargs:
raise DeviceError("One of group or remote must be specified for
vxlan")
+ if kwargs.get("remote", False) and
ipaddress(kwargs["remote"]).is_multicast():
+ logging.debug("ATTENTION: non-unicast remote IP set: %s" %
str(kwargs["remote"]))
+
+ if kwargs.get("group", False) and not
ipaddress(kwargs["group"]).is_multicast():
+ logging.debug("ATTENTION: non-multicast group IP set: %s" %
str(kwargs["group"]))
+
super(VxlanDevice, self).__init__(ifmanager, *args, **kwargs)
@property
--
2.17.1