Re: [RFC PATCH net-next 4/7] net: ip: make fib_validate_source() return drop reason

From: Menglong Dong
Date: Fri Sep 20 2024 - 02:25:09 EST


On Thu, Sep 19, 2024 at 10:43 PM Antoine Tenart <atenart@xxxxxxxxxx> wrote:
>
> Quoting Menglong Dong (2024-09-19 11:41:44)
> >
> > @@ -2339,8 +2345,11 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
> > if (!ipv4_is_zeronet(saddr)) {
> > err = fib_validate_source(skb, saddr, 0, tos, 0, dev,
> > in_dev, &itag);
> > - if (err < 0)
> > + if (err < 0) {
> > + err = -EINVAL;
> > + __reason = -err;
>
> That should be:
>
> __reason = -err;
> err = -EINVAL;

Oops, my mistake!

>
>
> Also this patch should take care of the fib_validate_source call in
> ip_mc_validate_source.

Yeah, I should do the same thing in ip_mc_validate_source().

Thanks!