mirror of
https://github.com/nmap/nmap.git
synced 2026-01-05 06:09:00 +00:00
Avoid deprecated pcap_lookupdev in Nping
This commit is contained in:
@@ -2388,9 +2388,8 @@ if( this->getMode()!=TCP_CONNECT && this->getMode()!=UDP_UNPRIV && this->getRole
|
||||
/* Try to obtain a device name from the target IP */
|
||||
if ( getNetworkInterfaceName( &ss , devbuff) != OP_SUCCESS ) {
|
||||
/* If that didn't work, ask libpcap */
|
||||
char errbuf[PCAP_ERRBUF_SIZE];
|
||||
if ( (dev = pcap_lookupdev(errbuf)) == NULL)
|
||||
nping_fatal(QT_3, "Cannot obtain device for packet capture --> %s", errbuf);
|
||||
if ( (dev = this->select_network_iface()) == NULL)
|
||||
nping_fatal(QT_3, "Cannot obtain device for packet capture");
|
||||
else
|
||||
this->setDevice( dev );
|
||||
/* Libpcap gave us a device name, try to obtain it's IP */
|
||||
|
||||
Reference in New Issue
Block a user