Skip to content

Commit 850c8a6

Browse files
committed
pcapint_do_addexit() fills the error buffer. [skip ci]
Do not do it in pcap_activate_bpf(), update the comments.
1 parent c36a817 commit 850c8a6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pcap-bpf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,9 +2084,8 @@ pcap_activate_bpf(pcap_t *p)
20842084
/*
20852085
* "atexit()" failed; don't create the
20862086
* interface, just give up.
2087+
* p->errbuf has already been filled.
20872088
*/
2088-
snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
2089-
"atexit failed");
20902089
close(s);
20912090
status = PCAP_ERROR;
20922091
goto bad;
@@ -3220,6 +3219,7 @@ monitor_mode(pcap_t *p, int set)
32203219
/*
32213220
* "atexit()" failed; don't put the interface
32223221
* in monitor mode, just give up.
3222+
* p->errbuf has already been filled.
32233223
*/
32243224
close(sock);
32253225
return (PCAP_ERROR);

pcap-linux.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5031,6 +5031,7 @@ enter_rfmon_mode(pcap_t *handle, int sock_fd, const char *device)
50315031
/*
50325032
* "atexit()" failed; don't put the interface
50335033
* in rfmon mode, just give up.
5034+
* handle->errbuf has already been filled.
50345035
*/
50355036
del_mon_if(handle, sock_fd, &nlstate, device,
50365037
handlep->mondevice);

0 commit comments

Comments
 (0)