Ping used to provide some sort of packet sniffing capabilities, this was in an era where hubs were used and tcpdump wasn't invented.
pr_iph() is a function that prints the IP header of the packet.
pr_retip() is essentially a wrapper function to pr_iph(), that also displays the source and destination ports of a TCP or UDP packet.
After ef9e6dc7eebe9830511602904d3ef5218d964080 some of this functionality was almost removed, to only display packets sent by us (26+ years ago).
At this point, reaching this code path was only possible by doctoring the original packet.
After 46d7b45a267b3d78c5054b210ff7b6c55bfca42b this code path can never be reached.
Remove the code.
Note that this essentially turns pr_retip() into pr_iph().
Details
Details
- Reviewers
asomers markj thj - Group Reviewers
network - Commits
- rG1dc1f6bd3138: ping: Remove pr_retip()
DISCLAIMER: My preferred route would be to implement D38431, however for reasons detailed in that review, we'll resort to fixing what we currently have.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sbin/ping/ping.c | ||
---|---|---|
1713–1714 | Why do we need this function at all? |
sbin/ping/ping.c | ||
---|---|---|
1713–1714 | Precisely! From the summary:
Let me know if the unification should go on a separate commit or squash it with this one? |
sbin/ping/ping.c | ||
---|---|---|
1713–1714 | I think you should just squash it into this one. |
sbin/ping/ping.c | ||
---|---|---|
1713–1714 | Will do! |