diff options
author | 2008-05-23 15:51:12 +0000 | |
---|---|---|
committer | 2008-05-23 15:51:12 +0000 | |
commit | 621c015e2fbe65fdf3205e452a522f5ed4896427 (patch) | |
tree | 55b799dfbba135124ee55d9ea801968c48dce9b3 /sys/netinet/tcp_usrreq.c | |
parent | - remove USER_LDT, it was never in a state where it would copile, nor will (diff) | |
download | wireguard-openbsd-621c015e2fbe65fdf3205e452a522f5ed4896427.tar.xz wireguard-openbsd-621c015e2fbe65fdf3205e452a522f5ed4896427.zip |
Deal with the situation when TCP nfs mounts timeout and processes
get hung in nfs_reconnect() because they do not have the proper
privilages to bind to a socket, by adding a struct proc * argument
to sobind() (and the *_usrreq() routines, and finally in{6}_pcbbind)
and do the sobind() with proc0 in nfs_connect.
OK markus@, blambert@.
"go ahead" deraadt@.
Fixes an issue reported by bernd@ (Tested by bernd@).
Fixes PR5135 too.
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 9752c57b043..c0918876e48 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.97 2008/05/15 19:40:38 markus Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.98 2008/05/23 15:51:12 thib Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -134,7 +134,7 @@ tcp6_usrreq(so, req, m, nam, control, p) struct proc *p; { - return tcp_usrreq(so, req, m, nam, control); + return tcp_usrreq(so, req, m, nam, control, p); } #endif @@ -145,10 +145,11 @@ tcp6_usrreq(so, req, m, nam, control, p) */ /*ARGSUSED*/ int -tcp_usrreq(so, req, m, nam, control) +tcp_usrreq(so, req, m, nam, control, p) struct socket *so; int req; struct mbuf *m, *nam, *control; + struct proc *p; { struct sockaddr_in *sin; struct inpcb *inp; @@ -239,10 +240,10 @@ tcp_usrreq(so, req, m, nam, control) case PRU_BIND: #ifdef INET6 if (inp->inp_flags & INP_IPV6) - error = in6_pcbbind(inp, nam); + error = in6_pcbbind(inp, nam, p); else #endif - error = in_pcbbind(inp, nam); + error = in_pcbbind(inp, nam, p); if (error) break; break; @@ -254,10 +255,10 @@ tcp_usrreq(so, req, m, nam, control) if (inp->inp_lport == 0) { #ifdef INET6 if (inp->inp_flags & INP_IPV6) - error = in6_pcbbind(inp, NULL); + error = in6_pcbbind(inp, NULL, p); else #endif - error = in_pcbbind(inp, NULL); + error = in_pcbbind(inp, NULL, p); } /* If the in_pcbbind() above is called, the tp->pf should still be whatever it was before. */ @@ -291,7 +292,7 @@ tcp_usrreq(so, req, m, nam, control) } if (inp->inp_lport == 0) { - error = in6_pcbbind(inp, NULL); + error = in6_pcbbind(inp, NULL, p); if (error) break; } @@ -307,7 +308,7 @@ tcp_usrreq(so, req, m, nam, control) } if (inp->inp_lport == 0) { - error = in_pcbbind(inp, NULL); + error = in_pcbbind(inp, NULL, p); if (error) break; } |