summaryrefslogtreecommitdiffstats
path: root/sbin/pfctl/pfctl_altq.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2014-08-16 13:20:44 +0000
committerbz <bz@FreeBSD.org>2014-08-16 13:20:44 +0000
commitf57b2f8c40a02efd21fa3715c5a67d2d20ee6025 (patch)
tree1aa51c1ccae4bbadb85f212b4553618e08047ded /sbin/pfctl/pfctl_altq.c
parent7aec0e65a0caaa4a6c2bcdd958f1186e716dd80b (diff)
downloadFreeBSD-src-f57b2f8c40a02efd21fa3715c5a67d2d20ee6025.zip
FreeBSD-src-f57b2f8c40a02efd21fa3715c5a67d2d20ee6025.tar.gz
MFC r259916:
Use feature_present(3) to determine whether to open an INET or an INET6 socket when needed to allow pfctl to work on noinet and noinet6 kernels (and try to provide a fallback using AF_LINK as best effort). Adjust the Makefile to also respect relevant src.conf(5) options for compile time decisions on INET and INET6 support. Reviewed by: glebius (no objections)
Diffstat (limited to 'sbin/pfctl/pfctl_altq.c')
-rw-r--r--sbin/pfctl/pfctl_altq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
index 40e11d5..ae566f8 100644
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -1122,7 +1122,7 @@ getifspeed(char *ifname)
struct ifreq ifr;
struct if_data ifrdat;
- if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0)
err(1, "socket");
bzero(&ifr, sizeof(ifr));
if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >=
@@ -1143,7 +1143,7 @@ getifmtu(char *ifname)
int s;
struct ifreq ifr;
- if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0)
err(1, "socket");
bzero(&ifr, sizeof(ifr));
if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >=
OpenPOWER on IntegriCloud