[PATCH odhcpd 2/2] router: always check ra_lifetime

Alin Năstac alin.nastac at gmail.com
Mon Feb 13 14:12:05 PST 2023


On Mon, Feb 13, 2023 at 9:18 PM <stijn at linux-ipv6.be> wrote:
>
> @@ -495,13 +503,10 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
>                         memcpy(addrs, iface->addr6, sizeof(*addrs) * valid_addr_cnt);
>
>                         /* Check default route */
> -                       if (iface->default_router) {
> -                               default_route = true;
> -
> -                               if (iface->default_router > 1)
> -                                       valid_prefix = true;
> -                       } else if (parse_routes(addrs, valid_addr_cnt))
> -                               default_route = true;
> +                       if (!default_route) {
> +                               if (parse_routes(addrs, valid_addr_cnt))
> +                                       default_route = true;
> +                       }
>                 }
>
>                 if (invalid_addr_cnt) {

Patch looks fine to me, I have only one suggestion: merge these 2 if
statements into one.



More information about the openwrt-devel mailing list