mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Oscar Maes <oscmaes92@gmail.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com,
	kuba@kernel.org, horms@kernel.org, shuah@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 1/2] net: ipv4: allow directed broadcast routes to use dst hint
Date: Tue, 19 Aug 2025 12:46:42 +0200	[thread overview]
Message-ID: <3bb31f61-08cd-4680-a16d-20c248e3e1c9@redhat.com> (raw)
In-Reply-To: <20250814140309.3742-2-oscmaes92@gmail.com>

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


  reply	other threads:[~2025-08-19 10:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 14:03 [PATCH net-next v2 0/2] " Oscar Maes
2025-08-14 14:03 ` [PATCH net-next v2 1/2] " Oscar Maes
2025-08-19 10:46   ` Paolo Abeni [this message]
2025-08-19  0:08     ` Oscar Maes
2025-08-14 14:03 ` [PATCH net-next v2 2/2] selftests: net: add test for dst hint mechanism with directed broadcast addresses Oscar Maes
2025-08-19 10:56   ` Paolo Abeni
2025-08-19  0:11     ` Oscar Maes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bb31f61-08cd-4680-a16d-20c248e3e1c9@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oscmaes92@gmail.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®