Subject: toolchain/19880: netinet/in.h won't compile with a C++ compiler
To: None <>
From: None <>
List: netbsd-bugs
Date: 01/16/2003 21:25:53
>Number:         19880
>Category:       toolchain
>Synopsis:       netinet/in.h won't compile with a C++ compiler
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 16 12:26:00 PST 2003
>Originator:     Jon Olsson
>Release:        NetBSD 1.6_STABLE
Monkey mafia
System: NetBSD 1.6_STABLE NetBSD 1.6_STABLE (APE) #3: Fri Jan 10 11:45:01 CET 2003 i386
Architecture: i386
Machine: i386
	netinet/in.h is not C++-safe, I discovered this while compiling the
	psi package. The fix is trivial, same fix has been applied
	to the OpenBSD in.h.
	#include <netinet/in.h> in a C++ program and compile
Patch included

RCS file: /cvsroot/src/sys/netinet/in.h,v
retrieving revision 1.58
diff -u -r1.58 in.h
--- in.h    2002/05/13 13:34:32 1.58
+++ in.h    2003/01/16 20:04:15
@@ -241,7 +241,11 @@
struct ip_opts {
   struct in_addr  ip_dst;     /* first hop, 0 w/o src rt */
+#if defined(__cplusplus)
+   __int8_t    Ip_opts[40];
	__int8_t    ip_opts[40];    /* actually variable in size */