diff mbox series

[ovs-dev] Allow LR to send RAs with only link local Ipv6.

Message ID 20241125140444.483663-1-mj.ponsonby@canonical.com
State Changes Requested
Headers show
Series [ovs-dev] Allow LR to send RAs with only link local Ipv6. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

MJ Ponsonby Nov. 25, 2024, 2:04 p.m. UTC
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 part of a larger effort to get BGP unnumbered working within OVN.

Signed-off-by: MJ Ponsonby <mj.ponsonby@canonical.com>
---
 controller/pinctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Frode Nordahl Nov. 25, 2024, 3:12 p.m. UTC | #1
Hello, MJ,

Thank you for your work on this, please review my comments in-line below.

On Mon, Nov 25, 2024 at 3:05 PM MJ Ponsonby <mj.ponsonby@canonical.com> wrote:
>
> 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.

A reference to standards documentation making the case for supporting
this would be in order here. I think you will find relevant support in
RFC 4861 [0], possibly in section 6.2.2.

> This is part of a larger effort to get BGP unnumbered working within OVN.
>
> Signed-off-by: MJ Ponsonby <mj.ponsonby@canonical.com>
> ---
>  controller/pinctrl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 3fb7e2fd7..b47387210 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -4171,7 +4171,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 && (strcmp(prefixes,"")!=0) &&
> +        !extract_ip_addresses(prefixes, &config->prefixes)) {

The check for the empty string could simply be if (prefixes &&
*prefixes != '\0' ...

>          VLOG_WARN("Invalid IPv6 prefixes: %s", prefixes);
>          goto fail;
>      }
> --
> 2.43.0

A test case confirming that the controller behaves as expected would be good.

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

--
Frode Nordahl

> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/controller/pinctrl.c b/controller/pinctrl.c
index 3fb7e2fd7..b47387210 100644
--- a/controller/pinctrl.c
+++ b/controller/pinctrl.c
@@ -4171,7 +4171,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 && (strcmp(prefixes,"")!=0) &&
+        !extract_ip_addresses(prefixes, &config->prefixes)) {
         VLOG_WARN("Invalid IPv6 prefixes: %s", prefixes);
         goto fail;
     }