Re: [PATCH] net/ipv4: return the real errno instead of -EINVAL

From: xu
Date: Sun Aug 06 2023 - 22:05:38 EST


>> @@ -236,7 +234,8 @@ static int ip_finish_output2(struct net *net, struct sock *sk, struct sk_buff *s
>> net_dbg_ratelimited("%s: No header cache and no neighbour!\n",
>> __func__);
>> kfree_skb_reason(skb, SKB_DROP_REASON_NEIGH_CREATEFAIL);
>> - return -EINVAL;
>> + res = PTR_ERR(neigh);
>> + return res;
>
>I believe this part could be written as
>
>- return -EINVAL;
>+ return PTR_ERR(neigh);
>
>
>and there is no need to change the code is other places. This will be
>easier to track/backport.

Sure, I initially wrote the same thing with you, but considering the convenience of maintainer review,
I deliberately modified some other parts of the code to present a clear context of the core
modifications.

>From your reply, I can see you agree with my key idea of this patch, so I have sent a v2 patch[1] according
to your view.

[1] https://lore.kernel.org/all/20230807015408.248237-1-xu.xin16@xxxxxxxxxx/