mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/replace-pcap-lookupdev'
* origin/topic/jsiwek/replace-pcap-lookupdev: Replace use of deprecated pcap_lookupdev()
This commit is contained in:
commit
ecd6139d09
3 changed files with 39 additions and 8 deletions
8
CHANGES
8
CHANGES
|
@ -1,4 +1,12 @@
|
||||||
|
|
||||||
|
3.1.0-dev.36 | 2019-08-13 22:42:54 +0000
|
||||||
|
|
||||||
|
* Replace use of deprecated pcap_lookupdev(). (Jon Siwek, Corelight)
|
||||||
|
|
||||||
|
* Use _exit() in Reporter::FatalError. (Jon Siwek, Corelight)
|
||||||
|
|
||||||
|
* GH-533: Use consistent "lib" install dir. (Jon Siwek, Corelight)
|
||||||
|
|
||||||
3.1.0-dev.30 | 2019-08-13 13:48:47 -0700
|
3.1.0-dev.30 | 2019-08-13 13:48:47 -0700
|
||||||
|
|
||||||
* Add new LogAscii::gzip_file_extension option. (Tim Wojtulewicz, Corelight)
|
* Add new LogAscii::gzip_file_extension option. (Tim Wojtulewicz, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.1.0-dev.30
|
3.1.0-dev.36
|
||||||
|
|
|
@ -56,15 +56,38 @@ void PcapSource::OpenLive()
|
||||||
char tmp_errbuf[PCAP_ERRBUF_SIZE];
|
char tmp_errbuf[PCAP_ERRBUF_SIZE];
|
||||||
|
|
||||||
// Determine interface if not specified.
|
// Determine interface if not specified.
|
||||||
if ( props.path.empty() )
|
|
||||||
props.path = pcap_lookupdev(tmp_errbuf);
|
|
||||||
|
|
||||||
if ( props.path.empty() )
|
if ( props.path.empty() )
|
||||||
{
|
{
|
||||||
safe_snprintf(errbuf, sizeof(errbuf),
|
pcap_if_t* devs;
|
||||||
"pcap_lookupdev: %s", tmp_errbuf);
|
|
||||||
Error(errbuf);
|
if ( pcap_findalldevs(&devs, tmp_errbuf) < 0 )
|
||||||
return;
|
{
|
||||||
|
safe_snprintf(errbuf, sizeof(errbuf),
|
||||||
|
"pcap_findalldevs: %s", tmp_errbuf);
|
||||||
|
Error(errbuf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( devs )
|
||||||
|
{
|
||||||
|
props.path = devs->name;
|
||||||
|
pcap_freealldevs(devs);
|
||||||
|
|
||||||
|
if ( props.path.empty() )
|
||||||
|
{
|
||||||
|
safe_snprintf(errbuf, sizeof(errbuf),
|
||||||
|
"pcap_findalldevs: empty device name");
|
||||||
|
Error(errbuf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
safe_snprintf(errbuf, sizeof(errbuf),
|
||||||
|
"pcap_findalldevs: no devices found");
|
||||||
|
Error(errbuf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine network and netmask.
|
// Determine network and netmask.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue