[ovs-dev] [PATCH ovn] Honour router_preference for solicited RA

Gabriele Cerami gcerami at redhat.com
Tue Jun 9 11:57:46 UTC 2020


On 09 Jun, Gabriele Cerami wrote:
> Problem is, the rest of the options assume mo_flags contains only addr_mode,
> so there's a bit more to rework to make everything pass again.

I got it to work reusing a single ra pointer, but I'm getting weird
results for the test 029 - ovn -- action parsing

I attached the testsuite.log but there's something I don't get about the
expectations for this test: All test cases expect prefix_opt->la_flags to
be 0x80 (on-link, stateful) even for stateless addr_modes

The code that is responsible for prefix_opt->la_flags is in
lib/actions.c:2645

prefix_opt->la_flags = IPV6_ND_RA_OPT_PREFIX_ON_LINK;
if (!(ra->mo_flags & IPV6_ND_RA_FLAG_MANAGED_ADDR_CONFIG)) {
            prefix_opt->la_flags |= IPV6_ND_RA_OPT_PREFIX_AUTONOMOUS;
}

If I'm reading this correctly, the la_flags starts at least with 0x80.
ra->mo_flags & IPV6_ND_RA_FLAG_MANAGED_ADDR_CONFIG is nonzero if M flag is
set (addr_mode is dhcpv6_stateful), zero otherwise.

That means that the IPV6_ND_RA_OPT_PREFIX_AUTONOMOUS la_flag is set if
ra M in not set, that is when addr_mode is not stateful

This is correct under RFC4861 section 4.6.2

But in the failing test cases the M flag is not set, yet they expect
IPV6_ND_RA_FLAG_MANAGED_ADDR_CONFIG to not be set. Reading:

tests/ovn.at:1383
addr_mode 0x00 -> la_flags 0x80 (0x00 slaac is stateless, la_flag should be 0xc0)
tests/ovn.at:1389
addr_mode 0x40 -> la_flags 0x80 (0x40 dhcpv6_stateless, la_flag should be
0xc0)

The addr_mode should be the first value immediately before the
ra->lifetime 0xffff so ff.80.ff.ff and ff.40.ff.ff
The la_flags should be the byte just before the long .ff.ff.ff.ff.ff
instead

Am I missing something ? If my analysis is correct, I'm not sure how
tests passed before. There's a lot going on there, I would have found
smaller tests useful in this case.
-------------- next part --------------
#                             -*- compilation -*-
29. ovn.at:811: testing ovn -- action parsing ...
./ovn.at:1596: ovstest test-ovn parse-actions < input.txt
--- expout	2020-06-09 11:12:50.488114204 +0100
+++ /workspace/repos/ovn/tests/testsuite.dir/at-groups/29/stdout	2020-06-09 11:12:50.496114230 +0100
@@ -566,13 +566,13 @@
 
 # put_nd_ra_opts
 reg1[0] = put_nd_ra_opts(addr_mode = "slaac", mtu = 1500, prefix = aef0::/64, slla = ae:01:02:03:04:05);
-    encodes as controller(userdata=00.00.00.08.00.00.00.00.00.01.de.10.00.00.00.40.86.00.00.00.ff.00.ff.ff.00.00.00.00.00.00.00.00.05.01.00.00.00.00.05.dc.03.04.40.c0.ff.ff.ff.ff.ff.ff.ff.ff.00.00.00.00.ae.f0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.01.01.ae.01.02.03.04.05,pause)
+    encodes as controller(userdata=00.00.00.08.00.00.00.00.00.01.de.10.00.00.00.40.86.00.00.00.ff.00.ff.ff.00.00.00.00.00.00.00.00.05.01.00.00.00.00.05.dc.03.04.40.80.ff.ff.ff.ff.ff.ff.ff.ff.00.00.00.00.ae.f0.00.00.00.00.00.00.00.00.00.00.00.00.00.00.01.01.ae.01.02.03.04.05,pause)
     has prereqs ip6
 reg1[0] = put_nd_ra_opts(addr_mode = "dhcpv6_stateful", slla = ae:01:02:03:04:10, mtu = 1450);
     encodes as controller(userdata=00.00.00.08.00.00.00.00.00.01.de.10.00.00.00.40.86.00.00.00.ff.80.ff.ff.00.00.00.00.00.00.00.00.01.01.ae.01.02.03.04.10.05.01.00.00.00.00.05.aa,pause)
     has prereqs ip6
 reg1[0] = put_nd_ra_opts(addr_mode = "dhcpv6_stateless", slla = ae:01:02:03:04:06, prefix = aef0::/64);
-    encodes as controller(userdata=00.00.00.08.00.00.00.00.00.01.de.10.00.00.00.40.86.00.00.00.ff.40.ff.ff.00.00.00.00.00.00.00.00.01.01.ae.01.02.03.04.06.03.04.40.c0.ff.ff.ff.ff.ff.ff.ff.ff.00.00.00.00.ae.f0.00.00.00.00.00.00.00.00.00.00.00.00.00.00,pause)
+    encodes as controller(userdata=00.00.00.08.00.00.00.00.00.01.de.10.00.00.00.40.86.00.00.00.ff.40.ff.ff.00.00.00.00.00.00.00.00.01.01.ae.01.02.03.04.06.03.04.40.80.ff.ff.ff.ff.ff.ff.ff.ff.00.00.00.00.ae.f0.00.00.00.00.00.00.00.00.00.00.00.00.00.00,pause)
     has prereqs ip6
 reg1[0] = put_nd_ra_opts(addr_mode = "slaac", mtu = 1500, prefix = aef0::/64);
     slla option not present
29. ovn.at:811: 29. ovn -- action parsing (ovn.at:811): FAILED (ovn.at:1596)


More information about the dev mailing list