Subject: toolchain/19880: netinet/in.h won't compile with a C++ compiler
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jon@ape.mine.nu>
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
>Closed-Date:
>Last-Modified:
>Originator: Jon Olsson
>Release: NetBSD 1.6_STABLE
>Organization:
Monkey mafia
>Environment:
System: NetBSD ape.mine.nu 1.6_STABLE NetBSD 1.6_STABLE (APE) #3: Fri Jan 10 11:45:01 CET 2003 root@ape.mine.nu:/usr/src/sys/arch/i386/compile/APE i386
Architecture: i386
Machine: i386
>Description:
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.
>How-To-Repeat:
#include <netinet/in.h> in a C++ program and compile
>Fix:
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];
+#else
__int8_t ip_opts[40]; /* actually variable in size */
+#endif
};
/*
>Release-Note:
>Audit-Trail:
>Unformatted: