Subject: kern/18956: 1.5.4_ALPHA kernel fails to compile with IPNOPRIVPORTS
To: None <gnats-bugs@gnats.netbsd.org>
From: None <lsd@sdf.lonestar.org>
List: netbsd-bugs
Date: 11/06/2002 23:51:47
>Number:         18956
>Category:       kern
>Synopsis:       Kernel fails to compile with IPNOPRIVPORTS.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 06 16:50:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.5.4_ALPHA Nov 04 2002
>Organization:
>Environment:
System: NetBSD
Architecture: i386
Machine: i386
>Description:

	Kernel fails to compile with IPNOPRIVPORTS. I think,
(but haven't tested without it, so can't be sure) that also INET6 would
have to be chosen as an option, in order to reproduce this.

	Problematical files: 
		MD5 (netinet6/in6_pcb.c) = bdd8d28a301061eb50473a5601c3c2c2
		MD5 (netinet6/in6_src.c) = a15084ccba3f1edd2800e1091609b6cf

>How-To-Repeat:

		Try to compile a kernel with IPNOPRIVPORTS (and there's a high
	chanche that INET6 would be required aswell in order to repeat).

>Fix:

	1. You could bind above private ports and then use NAT to make 
it "look",  like you're on a private port... Not exactly a fix.

	2. You could try without INET6. (havent tried, but gut feeling
says that it might work then). Again, not exactly a fix, even if it would
cause the kernel to compile.

	3. Modify a couple of lines in a couple of files:

-----BEGIN DIFF1-----
*** netinet6/in6_pcb.c		   Tue Aug 29 13:54:53 2000
--- in6_pcb.c.test		   Sat Nov  2 18:01:57 2002
***************
*** 149,155 ****
--- 149,157 ----
  	struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)NULL;
  	u_int16_t lport = 0;
  	int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
+ #ifndef IPNOPRIVPORTS
  	int error;
+ #endif
  
  	if (in6p->in6p_lport || !IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr))
  		return(EINVAL);
-----END DIFF1-----
-----BEGIN DIFF1-----
*** netinet6/in6_src.c		Tue Aug 29 13:54:54 2000
--- in6_src.c.test		Sat Nov  2 20:00:35 2002
***************
*** 333,339 ****
--- 333,341 ----
  	int wild = 0;
  	void *t;
  	u_int16_t min, max;
+ #ifndef IPNOPRIVPORTS
  	struct proc *p = curproc;		/* XXX */
+ #endif
  
  	/* XXX: this is redundant when called from in6_pcbbind */
  	if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0 &&
-----END DIFF2-----
>Release-Note:
>Audit-Trail:
>Unformatted: