From 3515b2fd2bb729d07cd9f61d9c9ccfdba34d065b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 24 Dec 2015 02:07:31 -0800 Subject: 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*.) --- pcap-linux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pcap-linux.c') 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)); -- cgit v1.2.3