Subject: kern/20559: netinet6/in6_pcb.c missing #include "opt_inet.h"
To: None <>
From: icmp <>
List: netbsd-bugs
Date: 03/03/2003 08:58:28
>Number:         20559
>Category:       kern
>Synopsis:       netinet6/in6_pcb.c missing #include "opt_inet.h" 
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 03 05:59:00 PST 2003
>Originator:     icmp
>Release:        NetBSD 1.6_STABLE
System: NetBSD 1.6_STABLE NetBSD 1.6_STABLE (GATEWAY) #1: Wed Jan 22 15:28:11 EST 2003 i386
Architecture: i386
Machine: i386
	When binding a IPv4-mapped IPv6 IP bind() fails and sets errno to EADDRNOTAVAIL when the IPv4 IP is clearly available (::ffff:, see Searching through the archives:  
is related and I find that the problem is fixed in recent -current; however, my machine and others exhibit the same behavior as w/o #define INET as opt_inet.h provides, an entire block of code in in6_pcb.c is omitted and it forces a faulty EADDRNOTAVAIL to be returned.
	cc test.c -o test  (see above)
	watch bind fail to bind ::ffff: w/ v6only=0

--- /root/in6_pcb.c     Mon Mar  3 08:54:23 2003
+++ in6_pcb.c   Mon Mar  3 08:54:35 2003
@@ -68,6 +68,7 @@
#include <sys/cdefs.h>
  __KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 2002/11/21 17:53:47 he Exp $");

+#include "opt_inet.h"
#include "opt_ipsec.h"

#include <sys/param.h>

(untested but I think it would fix it, anyone care to check? :)
 	missing #include "opt_inet.h" makes bind() erroneously return EADDRNOTAVAIL for IPv4-mapped IPv6 addresses