Skip to content

ipv6: update @ipv6_preserve_addr_order to check kernel order

Beniamino Galvani requested to merge bg/ipv6-addr-order into master

Test @ipv6_preserve_addr_order checks if the order of addresses changes by looking at nmcli output. Howevev, it assumes that addresses added by NM are listed before temporary addresses added by kernel.

This is the "ip address" order:

inet6 cafe:cafe::aa7b:6be1:ab25:eed/64 scope global temporary dynamic
   valid_lft 3599sec preferred_lft 1799sec
inet6 cafe:cafe::5677:8a6:99a0:30d6/64 scope global dynamic mngtmpaddr noprefixroute
   valid_lft 3599sec preferred_lft 1799sec
inet6 dead:beef::e2b0:73c4:3033:10ef/64 scope global temporary dynamic
   valid_lft 3596sec preferred_lft 1796sec
inet6 dead:beef::bbd0:7f21:f187:867f/64 scope global dynamic mngtmpaddr noprefixroute
   valid_lft 3596sec preferred_lft 1796sec
inet6 fe80::e46d:7cb6:4a28:5cb7/64 scope link noprefixroute

This is the nmcli order with NM from main branch:

  IP6.ADDRESS[1]:    cafe:cafe::5677:8a6:99a0:30d6/64
  IP6.ADDRESS[2]:    dead:beef::bbd0:7f21:f187:867f/64
  IP6.ADDRESS[3]:    cafe:cafe::aa7b:6be1:ab25:eed/64
  IP6.ADDRESS[4]:    dead:beef::e2b0:73c4:3033:10ef/64
  IP6.ADDRESS[5]:    fe80::e46d:7cb6:4a28:5cb7/64

Note how the orders don't match.

In the "next" branch, addresses in nmcli output are determined only by looking at kernel and so the output is the same as "ip". This seems more correct.

The purpose of the test is to ensure that the address order doesn't change when receiving RAs. We can do that by looking at "ip" output. In this way, the test works with both "main" and "next" branches of NM.

Merge request reports