Re: [PATCH v2] ipv4/raw: support binding to nonlocal addresses

From: David Ahern
Date: Wed Nov 17 2021 - 22:59:32 EST


On 11/17/21 5:14 PM, Riccardo Paolo Bestetti wrote:
>>> diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
>>> index 1e44a43acfe2..e540b0dcf085 100644
>>> --- a/net/ipv4/ping.c
>>> +++ b/net/ipv4/ping.c
>>> @@ -311,15 +311,11 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
>>> pr_debug("ping_check_bind_addr(sk=%p,addr=%pI4,port=%d)\n",
>>> sk, &addr->sin_addr.s_addr, ntohs(addr->sin_port));
>>>
>>> - if (addr->sin_addr.s_addr == htonl(INADDR_ANY))
>>> - chk_addr_ret = RTN_LOCAL;
>>> - else
>>> - chk_addr_ret = inet_addr_type(net, addr->sin_addr.s_addr);
>>
>> That was done intentionally in commit 0ce779a9f501
>>
>
> Should I remove this from the patch? Is there a particular reason why
> this was done in ping.c but not in the other places?
>

exactly. I did not see the big deal about changing it.