For the EVPN MAC/IP Advertisement Route, IP Address field might be
omitted in case of the L2VPN MAC advertisement (e.g., Cisco NX-OS).
This patch allows to specify the empty IP Address to advertise.

This patch is suggested by Albert Siersema for the interoperability
with other MP BGP EVPN VXLAN implementations.

Suggested-by: Albert Siersema <[email protected]>
Signed-off-by: IWASE Yusuke <[email protected]>
---
 ryu/services/protocols/bgp/api/prefix.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ryu/services/protocols/bgp/api/prefix.py 
b/ryu/services/protocols/bgp/api/prefix.py
index e175f17..a73a123 100644
--- a/ryu/services/protocols/bgp/api/prefix.py
+++ b/ryu/services/protocols/bgp/api/prefix.py
@@ -188,7 +188,10 @@ def is_valid_mac_addr(addr):
 
 @validate(name=IP_ADDR)
 def is_valid_ip_addr(addr):
-    if not (validation.is_valid_ipv4(addr)
+    # Note: Allows empty IP Address (means length=0).
+    # e.g.) L2VPN MAC advertisement of Cisco NX-OS
+    if not (addr is None
+            or validation.is_valid_ipv4(addr)
             or validation.is_valid_ipv6(addr)):
         raise ConfigValueError(conf_name=IP_ADDR,
                                conf_value=addr)
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to