Skip to contentSkip to conversation

IPv6 routes inserted into the kernel with 'route' end up with invalid type

DISCUSSION David Ahern 2 participants 2 messages Aug 23, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 7 lines · Toke Høiland-Jørgensen

Hi David

Tom noticed[0] that on newer kernels, the Bird routing daemon rejects IPv6 routes received from the kernel if those routes were inserted with the old 'route' utility (i.e., when they're inserted through the ioctl interface).

Quoted 9 lines

We tracked it down to the routes having an rtm_type of RTN_UNKNOWN, and a bit of git archaeology points suggestively at this commit:

e8478e80e5a ("net/ipv6: Save route type in rt6_info")

The same setup works with older kernels, so this seems like it's a regression, the age of 'route' notwithstanding. Any good ideas for the proper way to fix this?

Should be fixed by:

commit c7036d97acd2527cef145b5ef9ad1a37ed21bbe6

Author: David Ahern <[email protected]>
Date:   Wed Jun 19 10:50:24 2019 -0700

ipv6: Default fib6_type to RTN_UNICAST when not set

A user reported that routes are getting installed with type 0
(RTN_UNSPEC)
where before the routes were RTN_UNICAST. One example is from accel-ppp which apparently still uses the ioctl interface and does not set rtmsg_type. Another is the netlink interface where ipv6 does not require rtm_type to be set (v4 does). Prior to the commit in the Fixes tag the ipv6 stack converted type 0 to RTN_UNICAST, so restore that behavior.

Fixes e8478e80e5a7 ("net/ipv6: Save route type in rt6_info")
#2 lore raw
Quoted 34 lines · David Ahern
Quoted 7 lines · Toke Høiland-Jørgensen

Hi David

Tom noticed[0] that on newer kernels, the Bird routing daemon rejects IPv6 routes received from the kernel if those routes were inserted with the old 'route' utility (i.e., when they're inserted through the ioctl interface).

Quoted 9 lines

We tracked it down to the routes having an rtm_type of RTN_UNKNOWN, and a bit of git archaeology points suggestively at this commit:

e8478e80e5a ("net/ipv6: Save route type in rt6_info")

The same setup works with older kernels, so this seems like it's a regression, the age of 'route' notwithstanding. Any good ideas for the proper way to fix this?

Should be fixed by:

commit c7036d97acd2527cef145b5ef9ad1a37ed21bbe6

Author: David Ahern <[email protected]>
Date:   Wed Jun 19 10:50:24 2019 -0700

ipv6: Default fib6_type to RTN_UNICAST when not set

A user reported that routes are getting installed with type 0
(RTN_UNSPEC)
where before the routes were RTN_UNICAST. One example is from accel-ppp which apparently still uses the ioctl interface and does not set rtmsg_type. Another is the netlink interface where ipv6 does not require rtm_type to be set (v4 does). Prior to the commit in the Fixes tag the ipv6 stack converted type 0 to RTN_UNICAST, so restore that behavior.

Quoted 3 lines
Fixes e8478e80e5a7 ("net/ipv6: Save route type in rt6_info")

Ah, great! Guess that hasn't made its way to the stable and distribution kernels yet. Thanks for the pointer! :)

-Toke