6 ms·
Does anyone have a link to a place in ping source code which describes that behaviour?
by slavabobik 3y ago
Does anyone have a link to a place in ping source code which describes that behaviour?
- johnnny 3y agoTry:: $ dpkg -S /bin/ping iputils-ping: /bin/ping $ grep 'downloaded from' /usr/share/doc/iputils-ping/copyright It was downloaded from https://github.com/iputils/iputils $ git clone https://github.com/iputils/iputils ... $ cd iputils/ping Then a bit of looking around shows that in acknowledge() (an inline helper defined in ping.h), pipesize records the largest difference between the sequence number of the (last) outbound probe and than the sequence number of the inbound probe we're receiving. That function is called from gather_statistics() (for the happy path) and in a couple of other locations when receiving an ICMP error.
- easton 3y agoCool trick! For anyone who isn't conveniently on Linux: https://github.com/iputils/iputils/blob/master/ping/ping.h#L352 https://github.com/iputils/iputils/blob/master/ping/ping.h#L...
- Anthony-G 3y agoThanks for that. I like how you not only give us this particular fish but show how to catch other fish. Edit: for those whose first language is not English, I’m referring to https://en.wiktionary.org/wiki/give_a_man_a_fish_and_you_feed_him_for_a_day;_teach_a_man_to_fish_and_you_feed_him_for_a_lifetime https://en.wiktionary.org/wiki/give_a_man_a_fish_and_you_fee...
- mananaysiempre 3y agoOn Arch Linux, use $ pacman -Qqo $(which ping) # -Qqo is --query --quiet --own iputils $ asp export iputils && cd iputils $ # see PKGBUILD for URLs, or if you just want to have a look: $ gpg --import keys/pgp/*.asc # or pass --skippgpcheck to makepkg below $ makepkg -od && cd src # -od is --nobuild --nodeps On NixOS with the new-style CLI, using $ nix eval nixpkgs#iputils.src.url "https://github.com/iputils/iputils/archive/20221126.tar.gz" for the second step usually works, although I don’t know how to figure out the package name reliably (ls -l will usually point you in the right direction, but for ping it just gives you the wrapper).
- slavabobik 3y agoThank you for a great explanation!