Skip to content

Conversation

alinnastac
Copy link
Contributor

RFC 7084 L-3 requires router advertisement daemon to send RIO for every prefix delegation that allocates a prefix on the interface. There is one special case though where PIO advertise the on-link prefix route that conflicts with the RIO prefix.

Example:

  • CE-Router receives IA-PD 2001:db8:1234::/64
  • this prefix delegation gets assigned to the lan interface
  • odhcpd advertise on-link PIO with prefix 2001:db8:1234::/64

If original RFC 7084 L-3 would be followed, RA will also contain a RIO with prefix 2001:db8:1234::/64 which will require lan hosts to add the routes
2001:db8:1234::/64 dev br-lan # the on-link prefix route
2001:db8:1234::/64 dev br-lan nexthop fe80::1 # RIO route

@systemcrash
Copy link
Contributor

@alinnastac I'm running odhcpd patched with this - is there a trivial way to verify it?

Please rebase your changes on current master.

Please revise your commit (and first message) message to (I think it should read like this - did I get that correct?) the following:

 router: implement RFC 7084 errata 7699

RFC 7084 L-3 requires router advertisement daemon to send RIO for
every prefix delegation (PD) that allocates a prefix on the interface.
There is one edge case where odhcpd advertises the on-link
PIO prefix route that conflicts with the RIO prefix.

 - PIO = Prefix Information Option
 - RIO = Route Information Option

Example:
 - CE-Router receives IA-PD 2001:db8:1234::/64
 - this prefix gets assigned to the lan interface
 - odhcpd still advertises on-link PIO with prefix 2001:db8:1234::/64

RFC 7084 L-3 mandates that RA also contain a RIO with prefix
2001:db8:1234::/64 which require lan hosts to add the routes

   2001:db8:1234::/64 dev br-lan # the on-link prefix route
   2001:db8:1234::/64 dev br-lan nexthop fe80::1 # RIO route

@alinnastac
Copy link
Contributor Author

alinnastac commented Apr 13, 2025

is there a trivial way to verify it?

Pretty trivial to check the behavior of odhcpd, but upstream must provide a IA-PD DHCPv6 option with a prefix length set to 64 in order to trigger the change implemented in the patch.

Please rebase your changes on current master.

I don't think openwrt is interested in this fix, otherwise they would had merged it already years ago.

@systemcrash
Copy link
Contributor

I figured it needs upstream input. Just wanted to be sure.

This repo doesn’t get much love, admittedly - but rebase and make it ready. That I’m testing it is progress.

@alinnastac
Copy link
Contributor Author

You could also modify odhcp6c script to hardcode wan6 prefix delegation length to 64.

RFC 7084 L-3 requires router advertisement daemon to send RIO for
every prefix delegation that allocates a prefix on the interface.
There is one special case though where PIO advertise the on-link
prefix route that conflicts with the RIO prefix.

Example:
 - CE-Router receives IA-PD 2001:db8:1234::/64
 - this prefix delegation gets assigned to the lan interface
 - odhcpd advertise on-link PIO with prefix 2001:db8:1234::/64

If original RFC 7084 L-3 would be followed, RA will also contain
a RIO with prefix 2001:db8:1234::/64 which will require lan hosts
to add the routes
   2001:db8:1234::/64 dev br-lan # the on-link prefix route
   2001:db8:1234::/64 dev br-lan nexthop fe80::1 # RIO route

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
RFC 4191 section 4 states:
   ... When ceasing to be an advertising
   interface and sending Router Advertisements with a Router Lifetime of
   zero, the Router Advertisement SHOULD also set the Route Lifetime to
   zero in all Route Information Options.

Since RIOs reflect the prefix delegations owned by the router, it is
reasonable to assume that invalid RIOs should be sent along invalid PIOs
required by RFC 7084 L-13.

This extends the functionality introduced in commit 83e14f4 where
removed addresses were advertised as invalid PIO in 3 consecutive RAs.

Other related improvements introduced here:
   - further precaution has been taken in netlink.c to prevent possible
    overlapping between current list of interface IPv6 addresses and the
    list of invalid addresses
   - IPv6 route parsing was moved to netlink.c and was splitted in 2
     functions; this allows dprefix caching in iface->addr6 list,
     necessary for generating invalid RIOs after prefix get deleted
   - all prefixes are advertised as invalid on odhcpd shutdown

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
@alinnastac
Copy link
Contributor Author

@systemcrash I've rebased my commits over the current master branch, but I haven't tested the new commits in any way (not even compiled the code) as I no longer work with openwrt distro.

I will no longer contribute to this project, I'm tired of being ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants