summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2006-03-19 11:48:48 +0000
committerdwmalone <dwmalone@FreeBSD.org>2006-03-19 11:48:48 +0000
commit2dd230f5c3b1fcc26c7cbcf8fd6067cebfec0d10 (patch)
tree42e7dc0e36634f484a2981e672c28b262c3fded7 /sys/netinet6
parent5990508a1595e266d9025df3bc34333be67d53a2 (diff)
downloadFreeBSD-src-2dd230f5c3b1fcc26c7cbcf8fd6067cebfec0d10.zip
FreeBSD-src-2dd230f5c3b1fcc26c7cbcf8fd6067cebfec0d10.tar.gz
Make net.inet.ip.portrange.reservedhigh and
net.inet.ip.portrange.reservedlow apply to IPv6 aswell as IPv4. We could have made new sysctls for IPv6, but that potentially makes things complicated for mapped addresses. This seems like the least confusing option and least likely to cause obscure problems in the future. This change makes the mac_portacl module useful with IPv6 apps. Reviewed by: ume MFC after: 1 month
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6_pcb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index ae89aa3..d2a03e3 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -188,7 +188,8 @@ in6_pcbbind(inp, nam, cred)
struct inpcb *t;
/* GROSS */
- if (ntohs(lport) < IPV6PORT_RESERVED &&
+ if (ntohs(lport) <= ipport_reservedhigh &&
+ ntohs(lport) >= ipport_reservedlow &&
suser_cred(cred, SUSER_ALLOWJAIL))
return (EACCES);
if (so->so_cred->cr_uid != 0 &&
OpenPOWER on IntegriCloud