Skip to contentSkip to conversation

ping (iputils) review (call for help)

DISCUSSION Petr Vorel 4 participants 7 messages Nov 3, 2022 – Nov 10, 2022

Subsystems (2)
lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

Hi,

I'm sorry to bother you about userspace. I'm preparing new iputils release and I'm not sure about these two patches. As there has been many regressions, review from experts is more than welcome.

If you have time to review them, it does not matter if you post your comments/RBT in github or here (as long as you keep Cc me so that I don't overlook it).

BTW I wonder if it make sense to list Hideaki YOSHIFUJI as NETWORKING IPv4/IPv6 maintainer. If I'm not mistaken, it has been a decade since he was active.

* ping: Call connect() before sending/receiving
https://github.com/iputils/iputils/pull/391
=> I did not even knew it's possible to connect to ping socket, but looks like it works on both raw socket and on ICMP datagram socket.

* ping: revert "ping: do not bind to device when destination IP is on device
https://github.com/iputils/iputils/pull/396
=> the problem has been fixed in mainline and stable/LTS kernels therefore I suppose we can revert cc44f4c as done in this PR. It's just a question if we should care about people who run new iputils on older (unfixed) kernels.

Kind regards,
Petr

#1 lore raw
Quoted 11 lines · Petr Vorel

Hi,

I'm sorry to bother you about userspace. I'm preparing new iputils release and I'm not sure about these two patches. As there has been many regressions, review from experts is more than welcome.

If you have time to review them, it does not matter if you post your comments/RBT in github or here (as long as you keep Cc me so that I don't overlook it).

Quoted 7 lines

BTW I wonder if it make sense to list Hideaki YOSHIFUJI as NETWORKING IPv4/IPv6 maintainer. If I'm not mistaken, it has been a decade since he was active.

* ping: Call connect() before sending/receiving
https://github.com/iputils/iputils/pull/391
=> I did not even knew it's possible to connect to ping socket, but looks like it works on both raw socket and on ICMP datagram socket.

The workaround of not using the PING socket is:

# sysctl -w net.ipv4.ping_group_range="1 0"
Quoted 6 lines

* ping: revert "ping: do not bind to device when destination IP is on device
https://github.com/iputils/iputils/pull/396
=> the problem has been fixed in mainline and stable/LTS kernels therefore I suppose we can revert cc44f4c as done in this PR. It's just a question if we should care about people who run new iputils on older (unfixed) kernels.

cc44f4c has also caused some regression though it's only seen in the kselftests, and that is why I made the kernel fix. I don't know which regression is more serious regardless of the patch's correctness. :-). or can we put some changelog to say that this revert should be backported together with the kernel commit?

Thanks.

author
#2 lore raw

Hi Xin,

Quoted 15 lines · Petr Vorel
Quoted 13 lines

Hi,

I'm sorry to bother you about userspace. I'm preparing new iputils release and I'm not sure about these two patches. As there has been many regressions, review from experts is more than welcome.

If you have time to review them, it does not matter if you post your comments/RBT in github or here (as long as you keep Cc me so that I don't overlook it).

BTW I wonder if it make sense to list Hideaki YOSHIFUJI as NETWORKING IPv4/IPv6 maintainer. If I'm not mistaken, it has been a decade since he was active.

Quoted 7 lines
Quoted 4 lines

* ping: Call connect() before sending/receiving
https://github.com/iputils/iputils/pull/391
=> I did not even knew it's possible to connect to ping socket, but looks like it works on both raw socket and on ICMP datagram socket.

The workaround of not using the PING socket is:

# sysctl -w net.ipv4.ping_group_range="1 0"

Well raw socket requires capabilities or setuid. Because some distros has moved to ICMP datagram socket, this approach requires root.

Quoted 8 lines
Quoted 5 lines

* ping: revert "ping: do not bind to device when destination IP is on device
https://github.com/iputils/iputils/pull/396
=> the problem has been fixed in mainline and stable/LTS kernels therefore I suppose we can revert cc44f4c as done in this PR. It's just a question if we should care about people who run new iputils on older (unfixed) kernels.

cc44f4c has also caused some regression though it's only seen in the kselftests, and that is why I made the kernel fix. I don't know which regression is more serious regardless of the patch's correctness. :-).

I'd prefer users not being affected than fixed tests and ping not working.

BTW can you be more specific, which kselftests is affected? Ideally link to lore. In [1] you just mentioned "Jianlin noticed", I haven't found anything on lore.

Quoted 2 lines

or can we put some changelog to say that this revert should be backported together with the kernel commit?

Well, this practically means new iputils (compiled from git) will not work on older (unfixed) kernel. Probably not many people will be affected, but why to upset anybody?

If the problem now is just broken kselftests, I'd prefer keeping it long enough (at least 1 year?) before reverting it.

Kind regards,
Petr

[1] https://lore.kernel.org/all/ea03066bc7256ab86df8d3501f3440819305be57.1644988852.git.lucien.xin@gmail.com/

#3 lore raw
Quoted 35 lines · Petr Vorel

Hi Xin,

Quoted 15 lines · Petr Vorel
Quoted 13 lines

Hi,

I'm sorry to bother you about userspace. I'm preparing new iputils release and I'm not sure about these two patches. As there has been many regressions, review from experts is more than welcome.

If you have time to review them, it does not matter if you post your comments/RBT in github or here (as long as you keep Cc me so that I don't overlook it).

BTW I wonder if it make sense to list Hideaki YOSHIFUJI as NETWORKING IPv4/IPv6 maintainer. If I'm not mistaken, it has been a decade since he was active.

Quoted 7 lines
Quoted 4 lines

* ping: Call connect() before sending/receiving
https://github.com/iputils/iputils/pull/391
=> I did not even knew it's possible to connect to ping socket, but looks like it works on both raw socket and on ICMP datagram socket.

The workaround of not using the PING socket is:

# sysctl -w net.ipv4.ping_group_range="1 0"

Well raw socket requires capabilities or setuid. Because some distros has moved to ICMP datagram socket, this approach requires root.

Quoted 5 lines
Quoted 5 lines

* ping: revert "ping: do not bind to device when destination IP is on device
https://github.com/iputils/iputils/pull/396
=> the problem has been fixed in mainline and stable/LTS kernels therefore I suppose we can revert cc44f4c as done in this PR. It's just a question if we should care about people who run new iputils on older (unfixed) kernels.

Quoted 8 lines
Quoted 3 lines

cc44f4c has also caused some regression though it's only seen in the kselftests, and that is why I made the kernel fix. I don't know which regression is more serious regardless of the patch's correctness. :-).

I'd prefer users not being affected than fixed tests and ping not working.

BTW can you be more specific, which kselftests is affected? Ideally link to lore. In [1] you just mentioned "Jianlin noticed", I haven't found anything on lore.

Sure, here is the bz you can check for more details:

https://bugzilla.redhat.com/show_bug.cgi?id=2054023

Quoted 9 lines
Quoted 3 lines

or can we put some changelog to say that this revert should be backported together with the kernel commit?

Well, this practically means new iputils (compiled from git) will not work on older (unfixed) kernel. Probably not many people will be affected, but why to upset anybody?

If the problem now is just broken kselftests, I'd prefer keeping it long enough (at least 1 year?) before reverting it.

I'm okay with it as no real customers complain about it so far.

Thanks.

Quoted 5 lines

Kind regards,
Petr

[1] https://lore.kernel.org/all/ea03066bc7256ab86df8d3501f3440819305be57.1644988852.git.lucien.xin@gmail.com/

#4 lore raw
In reply to Petr Vorel
Quoted 10 lines · Petr Vorel

Hi,

I'm sorry to bother you about userspace. I'm preparing new iputils release and I'm not sure about these two patches. As there has been many regressions, review from experts is more than welcome.

If you have time to review them, it does not matter if you post your comments/RBT in github or here (as long as you keep Cc me so that I don't overlook it).

Quoted 7 lines

BTW I wonder if it make sense to list Hideaki YOSHIFUJI as NETWORKING IPv4/IPv6 maintainer. If I'm not mistaken, it has been a decade since he was active.

* ping: Call connect() before sending/receiving
https://github.com/iputils/iputils/pull/391
=> I did not even knew it's possible to connect to ping socket, but looks like it works on both raw socket and on ICMP datagram socket.

no strong opinion on this one. A command line option to use connect might be better than always doing the connect.

Quoted 7 lines

* ping: revert "ping: do not bind to device when destination IP is on device
https://github.com/iputils/iputils/pull/396
=> the problem has been fixed in mainline and stable/LTS kernels therefore I suppose we can revert cc44f4c as done in this PR. It's just a question if we should care about people who run new iputils on older (unfixed) kernels.

I agree with this change. If a user opts for device binding, the command should not try to guess if it is really needed.

author
#5 lore raw

Hi David,

first, thanks a lot for having a look!

Quoted 14 lines · Petr Vorel
Quoted 12 lines

Hi,

I'm sorry to bother you about userspace. I'm preparing new iputils release and I'm not sure about these two patches. As there has been many regressions, review from experts is more than welcome.

If you have time to review them, it does not matter if you post your comments/RBT in github or here (as long as you keep Cc me so that I don't overlook it).

BTW I wonder if it make sense to list Hideaki YOSHIFUJI as NETWORKING IPv4/IPv6 maintainer. If I'm not mistaken, it has been a decade since he was active.

Quoted 7 lines
Quoted 4 lines

* ping: Call connect() before sending/receiving
https://github.com/iputils/iputils/pull/391
=> I did not even knew it's possible to connect to ping socket, but looks like it works on both raw socket and on ICMP datagram socket.

no strong opinion on this one. A command line option to use connect might be better than always doing the connect.

I was thinking about it, as it'd be safer in case of some regression. If there is no other opinion I'll probably go this way, although I generally prefer not adding more command line options.

Quoted 9 lines
Quoted 5 lines

* ping: revert "ping: do not bind to device when destination IP is on device
https://github.com/iputils/iputils/pull/396
=> the problem has been fixed in mainline and stable/LTS kernels therefore I suppose we can revert cc44f4c as done in this PR. It's just a question if we should care about people who run new iputils on older (unfixed) kernels.

I agree with this change. If a user opts for device binding, the command should not try to guess if it is really needed.

I guess Sami Kerola (the patch author) preferred ping functionality on wrongly used ping's -I option. I've seen it the same even it causes kselftest regressions and wait a bit longer. But ok, anybody who would care should update kernel. I'll include this in upcoming iputils release.

Kind regards,
Petr

#6 lore raw

Hi,

2022年11月10日(木) 7:01 Petr Vorel <[email protected]>:

Quoted 13 lines

Hi David,

first, thanks a lot for having a look!

Quoted 7 lines
Quoted 7 lines

BTW I wonder if it make sense to list Hideaki YOSHIFUJI as NETWORKING IPv4/IPv6 maintainer. If I'm not mistaken, it has been a decade since he was active.

* ping: Call connect() before sending/receiving
https://github.com/iputils/iputils/pull/391
=> I did not even knew it's possible to connect to ping socket, but looks like it works on both raw socket and on ICMP datagram socket.

Quoted 5 lines
Quoted 2 lines

no strong opinion on this one. A command line option to use connect might be better than always doing the connect.

I was thinking about it, as it'd be safer in case of some regression. If there is no other opinion I'll probably go this way, although I generally prefer not adding more command line options.

+1: Because ping utility is a basic (or fundamental) tool for debugging networks,
I do prefer having an option like this to help low-level debugging.

--yoshfuji