From 43253483a86c6deee4e059609a1eb98f96e96054 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 17 Sep 2014 22:17:10 +0200 Subject: [PATCH] partly applied patch #8357: fix compiler warnings in tcpdump.c --- ports/unix/netif/tcpdump.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/unix/netif/tcpdump.c b/ports/unix/netif/tcpdump.c index 0267663..9cacebf 100644 --- a/ports/unix/netif/tcpdump.c +++ b/ports/unix/netif/tcpdump.c @@ -61,14 +61,16 @@ void tcpdump(struct pbuf *p) { struct ip_hdr *iphdr; - struct tcp_hdr *tcphdr; #if LWIP_UDP struct udp_hdr *udphdr; #endif +#if LWIP_TCP + struct tcp_hdr *tcphdr; char flags[5]; int i; int len; - int offset; + int offset +#endif; if (file == NULL) { return; @@ -163,8 +165,8 @@ tcpdump(struct pbuf *p) (int)(ntohl(iphdr->src.addr) >> 16) & 0xff, (int)(ntohl(iphdr->src.addr) >> 8) & 0xff, (int)(ntohl(iphdr->src.addr) >> 0) & 0xff, - ntohs(udphdr->src), (int)(ntohl(iphdr->dest.addr) >> 24) & 0xff, + ntohs(udphdr->src), (int)(ntohl(iphdr->dest.addr) >> 16) & 0xff, (int)(ntohl(iphdr->dest.addr) >> 8) & 0xff, (int)(ntohl(iphdr->dest.addr) >> 0) & 0xff,