forked from iputils/iputils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ping: Refactor socket mark failure handling
Ping warned 2x about setsockopt SO_MARK failure, because since 08f0e17 is called also for probe socket (before it was only on real socket): $ ping -m 2 ::1 ping: WARNING: failed to set mark: 2: Operation not permitted PING ::1 (::1) 56 data bytes ping: WARNING: failed to set mark: 2: Operation not permitted 64 bytes from ::1: icmp_seq=1 ttl=64 time=0.039 ms Therefore pass rts struct to: 1) Disable SO_MARK call on real socket when it failed on probe socket, therefore only single warning is printed. 2) Print hint about possible missing cap_net_admin+p capability $ ./builddir/ping/ping -m 2 ::1 ./builddir/ping/ping: WARNING: failed to set mark: 2: Operation not permitted ./builddir/ping/ping: => missing cap_net_admin+p capability? PING ::1 (::1) 56 data bytes 64 bytes from ::1: icmp_seq=1 ttl=64 time=0.053 ms Fixes: 08f0e17 ("ping: Set mark (SO_MARK) on probe socket") Fixes: iputils#515 Reviewed-by: Matthias Gerstner <matthias.gerstner@suse.com> Signed-off-by: Petr Vorel <pvorel@suse.cz>
- Loading branch information
Showing
4 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters