File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -889,9 +889,20 @@ main(int argc, char **argv)
889889 error ("-f and -r options are incompatible" );
890890 } else {
891891 if (device == NULL ) {
892- device = pcap_lookupdev (ebuf );
893- if (device == NULL )
892+ // pcap_lookupdev() will return Unicode string,
893+ // which will cause fault if passed to pcap_open() which accepts ASCII.
894+ // So we don't use it any more.
895+ // See: https://github.com/the-tcpdump-group/libpcap/issues/562
896+ // device = pcap_lookupdev(ebuf);
897+ // if (device == NULL)
898+ // error("%s", ebuf);
899+
900+ if (pcap_findalldevs (& devpointer , ebuf ) < 0 )
894901 error ("%s" , ebuf );
902+ if (devpointer == NULL )
903+ error ("%s" , "no adapter available" );
904+
905+ device = devpointer -> name ;
895906 }
896907#ifdef WIN32
897908 if (strlen (device ) == 1 ) //we assume that an ASCII string is always longer than 1 char
You can’t perform that action at this time.
0 commit comments