dhcpcd-discuss

IPv6 default route on FreeBSD with dhcpcd 6.11.2 points to lo0

Guy Yur

Thu Aug 04 20:36:11 2016

Hi,

With dhcpcd 6.11.2 on FreeBSD 10.3 and CURRENT, the ipv6 default route
is added with netif lo0 instead of the actual interface.
dhcpcd 6.11.1 adds the route correctly.


# netstat -rnf inet6
Routing tables

Internet6:
Destination                       Gateway                       Flags
    Netif Expire
::/96                             ::1                           UGRS        lo0
default                           fe80::NNNN:NNff:feNN:NNNN     UGS         lo0
::1                               link#2                        UH          lo0
...


Attaching a patch against trunk.
1. Initialize flags to rt->flags in if_route6, same as 6.11.1.
not adding RTF_UP because it is done by if_rtmsg.

2. Add RTA_IFP | RTA_IFA in case of not a RTF_REJECT route, same as 6.11.1.

3. Remove "if (rtm.hdr.rtm_flags & (RTF_GATEWAY | RTF_REJECT))" section
since the flags are added in (2) only if not RTF_REJECT and there are
other checks to remove RTA_IFP and RTA_IFA in if_route() for IPv4.

If you think (3) is still needed,
I think the check for:
(rtm.hdr.rtm_flags & (RTF_GATEWAY | RTF_REJECT))
should be:
((rtm.hdr.rtm_flags & (RTF_GATEWAY | RTF_REJECT)) == (RTF_GATEWAY | RTF_REJECT))


Thanks,
Guy

Attachment: ipv6-default-route.patch
Description: Binary data


Follow-Ups:
Re: IPv6 default route on FreeBSD with dhcpcd 6.11.2 points to lo0Roy Marples
Re: IPv6 default route on FreeBSD with dhcpcd 6.11.2 points to lo0Guy Yur
Archive administrator: postmaster@marples.name