Skip to content

Commit

Permalink
Allow LR to send RAs with only link local Ipv6.
Browse files Browse the repository at this point in the history
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.

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

Signed-off-by: MJ Ponsonby <mj.ponsonby@canonical.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
crypticC0der authored and ovsrobot committed Dec 10, 2024
1 parent f9ea3d1 commit 3210dfc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion controller/pinctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 && *prefixes != '\0' &&
!extract_ip_addresses(prefixes, &config->prefixes)) {
VLOG_WARN("Invalid IPv6 prefixes: %s", prefixes);
goto fail;
}
Expand Down
16 changes: 13 additions & 3 deletions tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -16543,7 +16543,7 @@ ovs-vsctl add-br 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

check ovn-nbctl ls-add sw
check ovn-nbctl lsp-add sw sw-ro
Expand Down Expand Up @@ -16649,6 +16649,11 @@ ra_test() {
rm -f expected
}

echo "Baseline test with 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

Expand Down Expand Up @@ -16794,7 +16799,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

check ovn-nbctl ls-add sw
check ovn-nbctl lsp-add sw ln
Expand Down Expand Up @@ -16909,7 +16914,12 @@ ra_test() {
rm -f expected
}

# check that RAs are sent to vifs
# check that RAs are sent to vifs without ipv6 prefix
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 with ipv6 prefix
ra_test 0 00 0 0 0 c0 40 aef00000000000000000000000000000

# check that RAs don't leak into provider networks
Expand Down

0 comments on commit 3210dfc

Please sign in to comment.