diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-01-31 17:05:16 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-02-11 14:41:07 +0900 |
commit | 6e78aa3b9417b2888fa2cf5a095ac03e343cdfad (patch) | |
tree | 6d33faf831cbea2f82297f4c411721858e24d6ab | |
parent | b0c9da18a05d1fedd0ad55e5635f909386db6988 (diff) |
BGPSpeaker: Allow empty IP Address in EVPN advertisement
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 <albert@mediacaster.nl>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/services/protocols/bgp/api/prefix.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ryu/services/protocols/bgp/api/prefix.py b/ryu/services/protocols/bgp/api/prefix.py index e175f176..a73a123c 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) |