From: Roy Marples Date: Tue, 20 May 2025 21:10:41 +0000 (+0100) Subject: IPv6: Clear previous address RA flags on receipt of a RA. X-Git-Tag: v10.2.4~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a35afcd891ba34802a837ec920ece0a63de65186;p=thirdparty%2Fdhcpcd.git IPv6: Clear previous address RA flags on receipt of a RA. This allows a prefix gateway to transition from onlink to not on link. Fixes #506. --- diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 39fe4731..cad5ce5b 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -189,6 +189,11 @@ static void routeinfohead_free(struct routeinfohead *); #define ipv6nd_free_ra(ra) ipv6nd_freedrop_ra((ra), 0) #define ipv6nd_drop_ra(ra) ipv6nd_freedrop_ra((ra), 1) +/* Clear these addrflags on receipt of a new RA before adding the new flags + * dervived from the RA. */ +#define RA_STALE_FLAGS \ + (IPV6_AF_ONLINK | IPV6_AF_AUTOCONF | IPV6_AF_ROUTER | IPV6_AF_STALE) + void ipv6nd_printoptions(const struct dhcpcd_ctx *ctx, const struct dhcp_opt *opts, size_t opts_len) @@ -1294,8 +1299,8 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, else ia->prefix_pltime = ia->prefix_vltime; + ia->flags &= ~RA_STALE_FLAGS; ia->flags |= flags; - ia->flags &= ~IPV6_AF_STALE; ia->acquired = rap->acquired; #ifdef IPV6_MANAGETEMPADDR