Subject: kern/18073: nfs reconnect hang up with tcp6
To: None <gnats-bugs@gnats.netbsd.org>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 08/26/2002 20:16:10
>Number: 18073
>Category: kern
>Synopsis: nfs reconnect hang up with tcp6
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 26 04:24:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release: NetBSD 1.6F
>Organization:
>Environment:
System: NetBSD capybara 1.6F NetBSD 1.6F (build.stg) #: Mon Aug 26 18:32:33 JST 2002 takashi@capybara:/usr/home/takashi/work/kernel/build.stg i386
Architecture: i386
Machine: i386
>Description:
in6_pcbsetport should take proc pointer.
otherwise, nfs_reconnect sucks unless the process is superuser.
>How-To-Repeat:
>Fix:
Index: in6_pcb.c
===================================================================
RCS file: /cvs/cvsroot/syssrc/sys/netinet6/in6_pcb.c,v
retrieving revision 1.49
diff -u -p -r1.49 in6_pcb.c
--- in6_pcb.c 2002/06/11 19:40:00 1.49
+++ in6_pcb.c 2002/08/26 10:39:58
@@ -276,7 +276,7 @@ in6_pcbbind(in6p, nam, p)
if (lport == 0) {
int e;
- if ((e = in6_pcbsetport(&in6p->in6p_laddr, in6p)) != 0)
+ if ((e = in6_pcbsetport(&in6p->in6p_laddr, in6p, p)) != 0)
return(e);
}
else
Index: in6_pcb.h
===================================================================
RCS file: /cvs/cvsroot/syssrc/sys/netinet6/in6_pcb.h,v
retrieving revision 1.20
diff -u -p -r1.20 in6_pcb.h
--- in6_pcb.h 2002/06/08 21:22:31 1.20
+++ in6_pcb.h 2002/08/26 10:39:58
@@ -177,7 +177,7 @@ void in6_setsockaddr __P((struct in6pcb
/* in in6_src.c */
int in6_selecthlim __P((struct in6pcb *, struct ifnet *));
-int in6_pcbsetport __P((struct in6_addr *, struct in6pcb *));
+int in6_pcbsetport __P((struct in6_addr *, struct in6pcb *, struct proc *));
extern struct rtentry *
in6_pcbrtentry __P((struct in6pcb *));
Index: in6_src.c
===================================================================
RCS file: /cvs/cvsroot/syssrc/sys/netinet6/in6_src.c,v
retrieving revision 1.13
diff -u -p -r1.13 in6_src.c
--- in6_src.c 2002/06/08 20:06:44 1.13
+++ in6_src.c 2002/08/26 10:39:58
@@ -335,9 +335,10 @@ in6_selecthlim(in6p, ifp)
* Find an empty port and set it to the specified PCB.
*/
int
-in6_pcbsetport(laddr, in6p)
+in6_pcbsetport(laddr, in6p, p)
struct in6_addr *laddr;
struct in6pcb *in6p;
+ struct proc *p;
{
struct socket *so = in6p->in6p_socket;
struct in6pcb *head = in6p->in6p_head;
@@ -354,8 +355,6 @@ in6_pcbsetport(laddr, in6p)
if (in6p->in6p_flags & IN6P_LOWPORT) {
#ifndef IPNOPRIVPORTS
- struct proc *p = curproc; /* XXX */
-
if (p == 0 || (suser(p->p_ucred, &p->p_acflag) != 0))
return (EACCES);
#endif
Index: udp6_output.c
===================================================================
RCS file: /cvs/cvsroot/syssrc/sys/netinet6/udp6_output.c,v
retrieving revision 1.8
diff -u -p -r1.8 udp6_output.c
--- udp6_output.c 2002/08/14 00:23:40 1.8
+++ udp6_output.c 2002/08/26 10:39:58
@@ -269,7 +269,7 @@ udp6_output(in6p, m, addr6, control, p)
goto release;
}
if (in6p->in6p_lport == 0 &&
- (error = in6_pcbsetport(laddr, in6p)) != 0)
+ (error = in6_pcbsetport(laddr, in6p, p)) != 0)
goto release;
} else {
if (IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) {
>Release-Note:
>Audit-Trail:
>Unformatted: