diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-05-23 15:51:13 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-05-23 15:51:13 +0000 |
commit | 114f984d932b1f6810293178a80279f30cd2bd27 (patch) | |
tree | 1a1f583d1f42425cfd75dad816a48f3121aff8d0 /sys/netinet/tcp_usrreq.c | |
parent | b9a20684fa94a5082c8e1df0b6f92099a2f7cb63 (diff) |
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; } |