diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/tcpdump/netdissect.h | 1 | ||||
-rw-r--r-- | contrib/tcpdump/print-pfsync.c | 16 | ||||
-rw-r--r-- | contrib/tcpdump/print.c | 3 | ||||
-rw-r--r-- | contrib/wpa/src/l2_packet/l2_packet_freebsd.c | 1 |
4 files changed, 12 insertions, 9 deletions
diff --git a/contrib/tcpdump/netdissect.h b/contrib/tcpdump/netdissect.h index 105c490..286b176 100644 --- a/contrib/tcpdump/netdissect.h +++ b/contrib/tcpdump/netdissect.h @@ -428,6 +428,7 @@ extern u_int netanalyzer_transparent_if_print IF_PRINTER_ARGS; extern u_int nflog_if_print IF_PRINTER_ARGS; extern u_int null_if_print IF_PRINTER_ARGS; extern u_int pflog_if_print IF_PRINTER_ARGS; +extern u_int pfsync_if_print IF_PRINTER_ARGS; extern u_int pktap_if_print IF_PRINTER_ARGS; extern u_int ppi_if_print IF_PRINTER_ARGS; extern u_int ppp_bsdos_if_print IF_PRINTER_ARGS; diff --git a/contrib/tcpdump/print-pfsync.c b/contrib/tcpdump/print-pfsync.c index 6291333..9159ad2 100644 --- a/contrib/tcpdump/print-pfsync.c +++ b/contrib/tcpdump/print-pfsync.c @@ -57,30 +57,28 @@ static void print_src_dst(netdissect_options *, const struct pfsync_state_peer *, uint8_t); static void print_state(netdissect_options *, struct pfsync_state *); -#ifdef notyet -void -pfsync_if_print(u_char *user, const struct pcap_pkthdr *h, +u_int +pfsync_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { u_int caplen = h->caplen; - ts_print(&h->ts); + ts_print(ndo, &h->ts); if (caplen < PFSYNC_HDRLEN) { ND_PRINT((ndo, "[|pfsync]")); goto out; } - pfsync_print((struct pfsync_header *)p, + pfsync_print(ndo, (struct pfsync_header *)p, p + sizeof(struct pfsync_header), caplen - sizeof(struct pfsync_header)); out: - if (xflag) { - default_print((const u_char *)p, caplen); - } + if (!ndo->ndo_suppress_default_print) + ND_DEFAULTPRINT(p, caplen); safeputchar(ndo, '\n'); + return (caplen); } -#endif /* notyet */ void pfsync_ip_print(netdissect_options *ndo , const u_char *bp, u_int len) diff --git a/contrib/tcpdump/print.c b/contrib/tcpdump/print.c index c76f344..16a5369 100644 --- a/contrib/tcpdump/print.c +++ b/contrib/tcpdump/print.c @@ -127,6 +127,9 @@ static const struct printer printers[] = { #ifdef DLT_LINUX_SLL { sll_if_print, DLT_LINUX_SLL }, #endif +#if defined(DLT_PFSYNC) && defined(HAVE_NET_PFVAR_H) + { pfsync_if_print, DLT_PFSYNC }, +#endif #ifdef DLT_FR { fr_if_print, DLT_FR }, #endif diff --git a/contrib/wpa/src/l2_packet/l2_packet_freebsd.c b/contrib/wpa/src/l2_packet/l2_packet_freebsd.c index aa83648..23a4155 100644 --- a/contrib/wpa/src/l2_packet/l2_packet_freebsd.c +++ b/contrib/wpa/src/l2_packet/l2_packet_freebsd.c @@ -208,6 +208,7 @@ static int eth_get(const char *device, u8 ea[ETH_ALEN]) (ifm->ifm_addrs & RTA_IFP) == 0) continue; if (sdl->sdl_family != AF_LINK || sdl->sdl_nlen == 0 || + (strlen(device) != sdl->sdl_nlen) || os_memcmp(sdl->sdl_data, device, sdl->sdl_nlen) != 0) continue; os_memcpy(ea, LLADDR(sdl), sdl->sdl_alen); |