]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-icmp.c
Default to first interface from pcap_findalldevs()
[tcpdump] / print-icmp.c
index 1c92d032e70e7d2ce7593a5f07ef7c19631f697a..ab3624e2dc78f5e0f31933028145be400cedeae2 100644 (file)
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
 #include <stdio.h>
 #include <string.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "addrtoname.h"
-#include "extract.h"                   /* must come after interface.h */
+#include "extract.h"
 
 #include "ip.h"
 #include "udp.h"
@@ -386,14 +386,14 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *
                                (void)snprintf(buf, sizeof(buf),
                                        "%s tcp port %s unreachable",
                                        ipaddr_string(ndo, &oip->ip_dst),
-                                       tcpport_string(dport));
+                                       tcpport_string(ndo, dport));
                                break;
 
                        case IPPROTO_UDP:
                                (void)snprintf(buf, sizeof(buf),
                                        "%s udp port %s unreachable",
                                        ipaddr_string(ndo, &oip->ip_dst),
-                                       udpport_string(dport));
+                                       udpport_string(ndo, dport));
                                break;
 
                        default:
@@ -556,7 +556,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *
        ND_PRINT((ndo, "ICMP %s, length %u", str, plen));
        if (ndo->ndo_vflag && !fragmented) { /* don't attempt checksumming if this is a frag */
                uint16_t sum, icmp_sum;
-               struct cksum_vec vec[1];
+
                if (ND_TTEST2(*bp, plen)) {
                        vec[0].ptr = (const uint8_t *)(const void *)dp;
                        vec[0].len = plen;