Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions driftnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,14 +656,19 @@ int main(int argc, char *argv[]) {
if (verbose)
fprintf(stderr, PROGNAME": using temporary file directory %s\n", tmpdir);

if (!interface && !(interface = pcap_lookupdev(ebuf))) {
if (!dumpfile && !interface && !(interface = pcap_lookupdev(ebuf))) {
fprintf(stderr, PROGNAME": pcap_lookupdev: %s\n", ebuf);
fprintf(stderr, PROGNAME": try specifying an interface with -i\n");
return -1;
}

if (verbose)
fprintf(stderr, PROGNAME": listening on %s%s\n", interface ? interface : "all interfaces", promisc ? " in promiscuous mode" : "");
if (verbose) {
if (interface) {
fprintf(stderr, PROGNAME": listening on %s%s\n", interface ? interface : "all interfaces", promisc ? " in promiscuous mode" : "");
} else if (dumpfile) {
fprintf(stderr, PROGNAME": processing packets from dumpfile '%s'\n", dumpfile);
}
}

/* Build up filter. */
if (optind < argc) {
Expand Down