public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nix <nix@esperi.org.uk>
To: Mariusz Mazur <mmazur@kernel.pl>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] linux-libc-headers-2.6.10.0: if_tunnel.h relies on byteorder.h having been included
Date: Sun, 13 Feb 2005 16:38:58 +0000	[thread overview]
Message-ID: <87k6pch0t9.fsf@amaterasu.srvr.nix> (raw)

In iproute2, ip/iptunnel.c says:

#include <linux/if.h>
#include <linux/if_arp.h>
#include <linux/ip.h>
#include <linux/if_tunnel.h>

Now the original Linux kernel includes byteorder.h as a side-effect of
including netdevice.h, which it does inside a __KERNEL__ ifdef when
if_arp.h is included.

I think it makes more sense to include it in those headers that actually
use the __constant_htons() macro, viz:

diff -durN 2.6.10.0-orig/include/linux/if_pppox.h 2.6.10.0/include/linux/if_pppox.h
--- 2.6.10.0-orig/include/linux/if_pppox.h	2004-10-31 19:55:51.000000000 +0000
+++ 2.6.10.0/include/linux/if_pppox.h	2005-02-13 16:28:58.000000000 +0000
@@ -21,6 +21,7 @@
 #include <asm/types.h>
 #include <endian.h>
 #include <byteswap.h>
+#include <asm/byteorder.h>
 
 /* For user-space programs to pick up these definitions
  * which they wouldn't get otherwise without defining __KERNEL__
diff -durN 2.6.10.0-orig/include/linux/if_tunnel.h 2.6.10.0/include/linux/if_tunnel.h
--- 2.6.10.0-orig/include/linux/if_tunnel.h	2004-10-31 19:55:26.000000000 +0000
+++ 2.6.10.0/include/linux/if_tunnel.h	2005-02-13 16:28:35.000000000 +0000
@@ -4,6 +4,7 @@
 #include <linux/if.h>
 #include <linux/ip.h>
 #include <asm/types.h>
+#include <asm/byteorder.h>
 
 #define SIOCGETTUNNEL   (SIOCDEVPRIVATE + 0)
 #define SIOCADDTUNNEL   (SIOCDEVPRIVATE + 1)
diff -durN 2.6.10.0-orig/include/linux/sctp.h 2.6.10.0/include/linux/sctp.h
--- 2.6.10.0-orig/include/linux/sctp.h	2005-01-08 14:03:26.000000000 +0000
+++ 2.6.10.0/include/linux/sctp.h	2005-02-13 16:29:36.000000000 +0000
@@ -53,6 +53,7 @@
 
 #include <linux/in.h>		/* We need in_addr.  */
 #include <linux/in6.h>		/* We need in6_addr.  */
+#include <asm/byteorder.h>
 
 
 /* Section 3.1.  SCTP Common Header Format */


(With this patch, the header stands alone, and iproute2 compiles again.)

-- 
Synapsids unite! You have nothing to lose but your eggshells!

             reply	other threads:[~2005-02-13 16:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-13 16:38 Nix [this message]
2005-02-13 21:09 ` [PATCH] linux-libc-headers-2.6.10.0: if_tunnel.h relies on byteorder.h having been included Mariusz Mazur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k6pch0t9.fsf@amaterasu.srvr.nix \
    --to=nix@esperi.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmazur@kernel.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox