Use (SOCK_DGRAM,IPPROTO_IP) socket instead of (SOCK_STREAM,IPPROTO_TCP).
This is exactly what Linux ifconfig does and seems to be the preferred way.
This commit is contained in:
parent
4cf45766ba
commit
567e6c6220
1 changed files with 1 additions and 1 deletions
|
@ -170,7 +170,7 @@ scan_if(timer *t)
|
||||||
void
|
void
|
||||||
scan_if_init(void)
|
scan_if_init(void)
|
||||||
{
|
{
|
||||||
if_scan_sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
|
if_scan_sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
|
||||||
DBG("Using socket %d for interface and route scanning\n", if_scan_sock);
|
DBG("Using socket %d for interface and route scanning\n", if_scan_sock);
|
||||||
if (if_scan_sock < 0)
|
if (if_scan_sock < 0)
|
||||||
die("Cannot create scanning socket: %m");
|
die("Cannot create scanning socket: %m");
|
||||||
|
|
Loading…
Reference in a new issue