This fixes a bug in OVN that causes ovn-controller to fail when Logical
Router Port configures send_periodic=true, but the Logical Router itself
doesn't have any globally routable IPv6 networks.

This is supported by RFC 4861 [0], in sections 6.2.2 and 4.2

This is part of a larger effort to get BGP unnumbered working within OVN.
Backport specific patch for v24.03.4.

[0]: https://datatracker.ietf.org/doc/html/rfc4861

Signed-off-by: MJ Ponsonby <[email protected]>
---
 controller/pinctrl.c |  3 ++-
 tests/ovn.at         | 16 +++++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index 5253e3126..5338f090b 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -3764,7 +3764,8 @@ ipv6_ra_update_config(const struct sbrec_port_binding *pb)
     }
 
     const char *prefixes = smap_get(&pb->options, "ipv6_ra_prefixes");
-    if (prefixes && !extract_ip_addresses(prefixes, &config->prefixes)) {
+    if (prefixes && *prefixes != '\0' &&
+        !extract_ip_addresses(prefixes, &config->prefixes)) {
         VLOG_WARN("Invalid IPv6 prefixes: %s", prefixes);
         goto fail;
     }
diff --git a/tests/ovn.at b/tests/ovn.at
index 11e8ba362..b5808d429 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -16588,7 +16588,7 @@ ovs-vsctl add-br br-phys
 ovn_attach n1 br-phys 192.168.0.3
 
 ovn-nbctl lr-add ro
-ovn-nbctl lrp-add ro ro-sw 00:00:00:00:00:01 aef0:0:0:0:0:0:0:1/64
+ovn-nbctl lrp-add ro ro-sw 00:00:00:00:00:01 20.0.0.1/24
 
 ovn-nbctl ls-add sw
 ovn-nbctl lsp-add sw sw-ro
@@ -16694,6 +16694,11 @@ ra_test() {
     rm -f expected
 }
 
+echo "Baseline test with no ipv6"
+ra_test 0 00 0 0 0 c0
+
+ovn-nbctl --wait=hv set Logical_Router_port ro-sw networks='aef0\:\:1/64'
+
 echo "Baseline test with no MTU"
 ra_test 0 00 0 0 0 c0 40 aef00000000000000000000000000000
 
@@ -16835,7 +16840,7 @@ check ovs-vsctl set open . 
external-ids:ovn-bridge-mappings=phys:br-phys
 ovn_attach n1 br-phys 192.168.0.3
 
 check ovn-nbctl lr-add ro
-check ovn-nbctl lrp-add ro ro-sw 00:00:00:00:00:01 aef0:0:0:0:0:0:0:1/64
+check ovn-nbctl lrp-add ro ro-sw 00:00:00:00:00:01 20.0.0.1/24
 
 check ovn-nbctl ls-add sw
 check ovn-nbctl lsp-add sw ln
@@ -16950,8 +16955,13 @@ ra_test() {
     rm -f expected
 }
 
+
+echo "Baseline test with no ipv6"
+check ra_test 0 00 0 0 0 c0
+ovn-nbctl --wait=hv set Logical_Router_port ro-sw networks='aef0\:\:1/64'
+
 # check that RAs are sent to vifs
-ra_test 0 00 0 0 0 c0 40 aef00000000000000000000000000000
+check ra_test 0 00 0 0 0 c0 40 aef00000000000000000000000000000
 
 # check that RAs don't leak into provider networks
 for i in hv1 hv2 ; do
-- 
2.43.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to