diff options
author | bz <bz@FreeBSD.org> | 2008-07-10 13:31:11 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2008-07-10 13:31:11 +0000 |
commit | 362cb79214c7ca17170d1530859aaf180e618d75 (patch) | |
tree | 465d7c3dd198bb4a6aefe767a4b80dc63c877b5a /sys/netinet | |
parent | 3881e50cbab0a113c2b83bf15fd896c969e4224e (diff) | |
download | FreeBSD-src-362cb79214c7ca17170d1530859aaf180e618d75.zip FreeBSD-src-362cb79214c7ca17170d1530859aaf180e618d75.tar.gz |
Pass the ucred along into in{,6}_pcblookup_local for upcoming
prison checks.
Reviewed by: rwatson
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in_pcb.c | 14 | ||||
-rw-r--r-- | sys/netinet/in_pcb.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 6fe60c3..4d7ceff 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -347,9 +347,9 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) && priv_check_cred(so->so_cred, PRIV_NETINET_REUSEPORT, 0) != 0) { - t = in_pcblookup_local(pcbinfo, - sin->sin_addr, lport, - prison ? 0 : INPLOOKUP_WILDCARD); + t = in_pcblookup_local(pcbinfo, sin->sin_addr, + lport, prison ? 0 : INPLOOKUP_WILDCARD, + cred); /* * XXX * This entire block sorely needs a rewrite. @@ -369,7 +369,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, if (prison && prison_ip(cred, 0, &sin->sin_addr.s_addr)) return (EADDRNOTAVAIL); t = in_pcblookup_local(pcbinfo, sin->sin_addr, - lport, prison ? 0 : wild); + lport, prison ? 0 : wild, cred); if (t && (t->inp_vflag & INP_TIMEWAIT)) { /* * XXXRW: If an incpb has had its timewait @@ -465,8 +465,8 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, if (*lastport < first || *lastport > last) *lastport = first; lport = htons(*lastport); - } while (in_pcblookup_local(pcbinfo, laddr, lport, - wild)); + } while (in_pcblookup_local(pcbinfo, laddr, + lport, wild, cred)); } if (prison_ip(cred, 0, &laddr.s_addr)) return (EINVAL); @@ -881,7 +881,7 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet *ifp) #define INP_LOOKUP_MAPPED_PCB_COST 3 struct inpcb * in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr, - u_short lport, int wild_okay) + u_short lport, int wild_okay, struct ucred *cred) { struct inpcb *inp; #ifdef INET6 diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index b72d1e5..d412843 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -452,7 +452,7 @@ void in_pcbfree(struct inpcb *); int in_pcbinshash(struct inpcb *); struct inpcb * in_pcblookup_local(struct inpcbinfo *, - struct in_addr, u_short, int); + struct in_addr, u_short, int, struct ucred *); struct inpcb * in_pcblookup_hash(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *); |