summaryrefslogtreecommitdiff
path: root/print-sll.c
diff options
context:
space:
mode:
authorDenis Ovsienko <denis@ovsienko.info>2018-07-21 22:50:25 +0100
committerDenis Ovsienko <denis@ovsienko.info>2018-07-21 22:50:53 +0100
commit19a552ae283d078c7223ceab3d757549d338b437 (patch)
tree934ece810242e39c08bd0a31d66bab886ea05ce3 /print-sll.c
parent3e3bb970a8316545428fe89e0bf82ea2be92b482 (diff)
downloadtcpdump-19a552ae283d078c7223ceab3d757549d338b437.tar.gz
Squelch a -Wdeclaration-after-statement warning.
./print-sll.c: In function ‘sll2_if_print’: ./print-sll.c:419:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] uint32_t index = EXTRACT_BE_U_4(sllp->sll2_if_index); ^~~~~~~~ [skip ci]
Diffstat (limited to 'print-sll.c')
-rw-r--r--print-sll.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/print-sll.c b/print-sll.c
index e6c7bd4a..17e9c750 100644
--- a/print-sll.c
+++ b/print-sll.c
@@ -400,6 +400,7 @@ sll2_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
int llc_hdrlen;
u_int hdrlen;
#ifdef HAVE_NET_IF_H
+ uint32_t index;
char ifname[IF_NAMESIZE];
#endif
@@ -416,7 +417,7 @@ sll2_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
sllp = (const struct sll2_header *)p;
#ifdef HAVE_NET_IF_H
- uint32_t index = EXTRACT_BE_U_4(sllp->sll2_if_index);
+ index = EXTRACT_BE_U_4(sllp->sll2_if_index);
if (if_indextoname(index, ifname))
ND_PRINT("ifindex %u (%s) ", index, ifname);
else