]> The Tcpdump Group git mirrors - tcpdump/commit
SLL2: Translate interface indices to names on Linux only. 1163/head
authorDenis Ovsienko <[email protected]>
Mon, 1 Apr 2024 12:26:28 +0000 (13:26 +0100)
committerDenis Ovsienko <[email protected]>
Tue, 2 Apr 2024 10:36:13 +0000 (11:36 +0100)
commit0e04b9da80f649e4ac11dee39af0550fee79cc69
tree7122fe3515ed30cf9ab2c25a06c18d22351adf16
parentb779eda489a90db6d63c325c7bd60763b3887016
SLL2: Translate interface indices to names on Linux only.

print-sll.c uses HAVE_NET_IF_H, which does not always work right: the
header is in POSIX.1-2001, but the result of if_indextoname() is
irrelevant if the current OS is not Linux, in which case the packet was
captured on a different host because libpcap produces DLT_LINUX_SLL2 on
Linux only.  The result can be irrelevant on Linux too, but this does
not have an easy solution.

To reduce the problem space, switch print-sll.c to check for __linux__
instead.  In tcpdump.c print the warning about interface names only if
sll2_if_print() would print interface names.  Since HAVE_NET_IF_H has no
purpose now, remove the checks for <net/if.h>.
CHANGES
CMakeLists.txt
cmakeconfig.h.in
configure.ac
print-sll.c
tcpdump.c