trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinson Lee <vlee@freedesktop.org>
To: trinity@vger.kernel.org
Subject: [PATCH] net/proto-ipv4.c: Include limits.h as a workaround for older kernels.
Date: Mon, 14 Mar 2016 16:54:15 -0700	[thread overview]
Message-ID: <1457999655-28780-1-git-send-email-vlee@freedesktop.org> (raw)

For example, CentOS 6 kernel-headers-2.6.32-573.18.1.el6.x86_64
linux/netfilter_ipv4.h does not include limits.h and results in this
build error.

  CC	net/proto-ipv4.o
In file included from /usr/include/linux/netfilter_ipv4/ip_tables.h:20,
                 from net/proto-ipv4.c:12:
/usr/include/linux/netfilter_ipv4.h:53: error: ‘INT_MIN’ undeclared here (not in a function)
/usr/include/linux/netfilter_ipv4.h:64: error: ‘INT_MAX’ undeclared here (not in a function)

This was fixed in upstream 3.2 598aaff2ee05c91728e5845956dd9754ed04315c.

commit 598aaff2ee05c91728e5845956dd9754ed04315c
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Wed Aug 24 18:45:36 2011 +0000

    headers, netfilter: Add missing #include <limits.h> for userland

    Various headers use INT_MIN and INT_MAX, which are defined for
    userland in <limits.h>.

    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    Acked-by: Patrick McHardy <kaber@trash.net>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 net/proto-ipv4.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/proto-ipv4.c b/net/proto-ipv4.c
index 0be0263..be24d37 100644
--- a/net/proto-ipv4.c
+++ b/net/proto-ipv4.c
@@ -9,6 +9,7 @@
 #include <arpa/inet.h>
 #include <linux/mroute.h>
 #include <linux/if.h>
+#include <limits.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 #include <linux/netfilter_bridge/ebtables.h>
 #include <linux/netfilter_arp/arp_tables.h>
-- 
1.7.1

                 reply	other threads:[~2016-03-14 23:54 UTC|newest]

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

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=1457999655-28780-1-git-send-email-vlee@freedesktop.org \
    --to=vlee@freedesktop.org \
    --cc=trinity@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).