Re: [PATCH net-next v2 1/2] net: ipv4: allow directed broadcast routes to use dst hint
From: Paolo Abeni
Date: Tue Aug 19 2025 - 06:47:43 EST
On 8/14/25 4:03 PM, Oscar Maes wrote:
> diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
> index fc323994b1fa..57bf6e23b342 100644
> --- a/net/ipv4/ip_input.c
> +++ b/net/ipv4/ip_input.c
> @@ -587,9 +587,13 @@ static void ip_sublist_rcv_finish(struct list_head *head)
> }
>
> static struct sk_buff *ip_extract_route_hint(const struct net *net,
> - struct sk_buff *skb, int rt_type)
> + struct sk_buff *skb)
> {
> - if (fib4_has_custom_rules(net) || rt_type == RTN_BROADCAST ||
> + const struct iphdr *iph = ip_hdr(skb);
> +
> + if (fib4_has_custom_rules(net) ||
> + ipv4_is_lbcast(iph->daddr) ||
> + (iph->daddr == 0 && iph->saddr == 0) ||
ipv4_is_zeronet(iph->daddr) is preferred for the daddr check, and it's
not clear why the new check for the saddr is needed here.
/P