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

From: Vadim Fedorenko
Date: Tue Aug 08 2023 - 12:34:01 EST


On 07/08/2023 02:54, xu.xin.sc@xxxxxxxxx wrote:
From: xu xin <xu.xin16@xxxxxxxxxx>

For now, No matter what error pointer ip_neigh_for_gw() returns,
ip_finish_output2() always return -EINVAL, which may mislead the upper
users.

For exemple, an application uses sendto to send an UDP packet, but when the
neighbor table overflows, sendto() will get a value of -EINVAL, and it will
cause users to waste a lot of time checking parameters for errors.

Return the real errno instead of -EINVAL.

Signed-off-by: xu xin <xu.xin16@xxxxxxxxxx>
Reviewed-by: Yang Yang <yang.yang29@xxxxxxxxxx>
Cc: Si Hao <si.hao@xxxxxxxxxx>
---

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>