Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit344012b

Browse files
committed
Fix the issue that WinDump fails to run on default adapter with no arguments, see:the-tcpdump-group/libpcap#562
1 parent5dffebe commit344012b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎Tcpdump.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff 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
#ifdefWIN32
897908
if(strlen(device)==1)//we assume that an ASCII string is always longer than 1 char

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp