Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Matti Aarnio <matti.aarnio@tele.fi>
Subject: 2.1.59 include bug (and patch)
Date: Thu, 23 Oct 1997 11:22:04 +0300 (EET DST)	[thread overview]
Message-ID: <77809e6ee51ce7f2cb0aaafe9023b2b8.axp-list@archive.invalid> (raw)

Hello,

	(patch way down below)

	I am writing software that uses IPv6, and I am trying to do
	it in utmost portable way.  That is, my code autoconfigures
	to see what kind of system there is, and what facilities it
	has.

	I have 2.1.59/VGER sources running both at my i686 box, and
	at my Alpha.  Both have RedHat 4.2 (more or less)

	These systems are quite different when it comes to the use of
	kernel defined  <asm/*.h> and <linux/*.h>  files.

	The Alpha systems have had GNU LIBC in them, while i686 has
	libc5.  The GNU LIBC does not include any of the <asm/*.h>,
	nor <linux/*.h> files, but also it does not have complete
	IPv6 API in.

	My software therefore has following includes for it to
	work my IPv6 platforms:

#include <sys/socket.h>
#include <netinet/in.h>
#ifdef HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
#ifdef HAVE_NETINET6_IN6_H
#include <netinet6/in6.h>
#endif
#ifdef HAVE_LINUX_IN6_H
#include <linux/in6.h>
#endif

#include <netdb.h>
#if !defined(EAI_AGAIN) || !defined(AI_NONAME)
#include "netdb6.h"
#endif

	These last two fill in lacking details for  getaddrinfo(), and
	getnameinfo()  API uses what the system might have..

	Basically all things that IPv6 application needs should be
	available thru  <netinet/in.h>  without having to resort to
	calling system specific things like  <linux/in6.h>.

	Anyway, when this application includes  <linux/in6.h>, it begins
	to complain about type  __u8  in the Alpha, but not in i686.
	It took me a while to realize that the reason is that this file
	does not have #include <linux/types.h>, while <linux/in.h> does
	have it...

# diff -u /usr/include/linux/in6.h{~,}
--- /usr/include/linux/in6.h~   Thu Oct 23 11:17:17 1997
+++ /usr/include/linux/in6.h    Thu Oct 23 11:17:33 1997
@@ -21,6 +21,7 @@
 #ifndef _LINUX_IN6_H
 #define _LINUX_IN6_H
 
+#include <linux/types.h>
 
 /*
  *     IPv6 address structure

/Matti Aarnio <matti.aarnio@tele.fi>

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

                 reply	other threads:[~1997-10-23  8:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox