diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-12-24 02:07:31 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-12-24 02:07:31 -0800 |
commit | 3515b2fd2bb729d07cd9f61d9c9ccfdba34d065b (patch) | |
tree | 13cd3b390d32e5b73223a36abdd62a4478ea12e6 /pcap-linux.c | |
parent | 26bb2e5d087d306088f8c36987d4c34d98d9ed0b (diff) |
Use PF_PACKET/SOCK_RAW sockets as "generic" sockets.
That way, uou don't have to have AF_INET support. (You have to have
PF_PACKET support, but you need that for those code paths *anyway*.)
Diffstat (limited to 'pcap-linux.c')
-rw-r--r-- | pcap-linux.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pcap-linux.c b/pcap-linux.c index 90459f8e..775a8602 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -2330,7 +2330,7 @@ scan_sys_class_net(pcap_if_t **devlistp, char *errbuf) /* * Create a socket from which to fetch interface information. */ - fd = socket(AF_INET, SOCK_DGRAM, 0); + fd = socket(PF_PACKET, SOCK_RAW, 0); if (fd < 0) { (void)pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, "socket: %s", pcap_strerror(errno)); @@ -2448,7 +2448,7 @@ scan_proc_net_dev(pcap_if_t **devlistp, char *errbuf) /* * Create a socket from which to fetch interface information. */ - fd = socket(AF_INET, SOCK_DGRAM, 0); + fd = socket(PF_PACKET, SOCK_RAW, 0); if (fd < 0) { (void)pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, "socket: %s", pcap_strerror(errno)); @@ -6024,7 +6024,7 @@ iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf) /* * Create a socket from which to fetch time stamping capabilities. */ - fd = socket(AF_INET, SOCK_DGRAM, 0); + fd = socket(PF_PACKET, SOCK_RAW, 0); if (fd < 0) { (void)pcap_snprintf(ebuf, PCAP_ERRBUF_SIZE, "socket for SIOCETHTOOL(ETHTOOL_GET_TS_INFO): %s", pcap_strerror(errno)); |