]> The Tcpdump Group git mirrors - tcpdump/commitdiff
adjust order of elements in ndo_printers[]
authorDenis Ovsienko <[email protected]>
Sat, 7 Sep 2013 10:27:18 +0000 (14:27 +0400)
committerDenis Ovsienko <[email protected]>
Sat, 7 Sep 2013 10:27:18 +0000 (14:27 +0400)
DLT_EN10MB, the most commonly seen datalink type, used to be the first
element of ndo_printers[], which lookup_ndo_printer() iterates over, but
commit 20ad836 made DLT_NFLOG the first. Move DLT_NFLOG to the last
position to make the function spend the same time processing the
previously recognized datalink types as before.

tcpdump.c

index b165e52712f9679b32b15d653cb228ad44b92a0f..c4b287c699056c6d92f32553aa8d6c25b6d7ea6f 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -312,11 +312,6 @@ static struct printer printers[] = {
 };
 
 static struct ndo_printer ndo_printers[] = {
-#ifdef DLT_NFLOG
-#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H
-       { nflog_if_print,       DLT_NFLOG},
-#endif
-#endif
        { ether_if_print,       DLT_EN10MB },
 #ifdef DLT_IPNET
        { ipnet_if_print,       DLT_IPNET },
@@ -335,6 +330,11 @@ static struct ndo_printer ndo_printers[] = {
 #endif
 #ifdef DLT_NETANALYZER_TRANSPARENT
        { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT },
+#endif
+#ifdef DLT_NFLOG
+#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H
+       { nflog_if_print,       DLT_NFLOG},
+#endif
 #endif
        { NULL,                 0 },
 };