Skip to contentSkip to conversation

iptables: Add limits.h to get INT_MIN, INT_MAX, ...

PATCH Applied Stephen Hemminger 3 participants 7 messages Feb 21, 2009 – Feb 25, 2009 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iptables: Add limits.h to get INT_MIN, INT_MAX, ...

Fix build failure of iptables utilities on debian/ubuntu, maybe other distros. The values INT_MIN and INT_MAX are used by many filters and these are defined in limits.h
---
patch against current iptables.git

include/xtables.h.in +1 -0
index b5f1af2..e346778 100644
@@ -8,6 +8,7 @@
 
 #include <sys/socket.h> /* PF_* */
 #include <sys/types.h>
+#include <limits.h>
 #include <stdbool.h>
 #include <netinet/in.h>
 #include <net/if.h>
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 3 lines · Stephen Hemminger

Fix build failure of iptables utilities on debian/ubuntu, maybe other distros. The values INT_MIN and INT_MAX are used by many filters and these are defined in limits.h

No this is not right IMO, limits.h should be included for the same reason you would not do that to kernel's .h files. Instead, limits.h should go in the .c files.

#2 lore raw
Quoted 9 lines · Jan Engelhardt
Quoted 3 lines · Stephen Hemminger

Fix build failure of iptables utilities on debian/ubuntu, maybe other distros. The values INT_MIN and INT_MAX are used by many filters and these are defined in limits.h

No this is not right IMO, limits.h should be included for the same reason you would not do that to kernel's .h files. Instead, limits.h should go in the .c files.

I wonder what debian has different in its Glibc files that limits.h is not included like it is for everybody else.

Anyway, of course it should be included where due. Gawd, that led me to have clean some unnecessary includes up beforehand, but oh well.

Could you try the "limits" branch of git://dev.medozas.de/iptables
if it compiles for you?

Jan

#3 lore raw
Quoted 11 lines · Jan Engelhardt
Quoted 7 lines · Jan Engelhardt
Quoted 3 lines · Stephen Hemminger

Fix build failure of iptables utilities on debian/ubuntu, maybe other distros. The values INT_MIN and INT_MAX are used by many filters and these are defined in limits.h

No this is not right IMO, limits.h should be included for the same reason you would not do that to kernel's .h files. Instead, limits.h should go in the .c files.

I wonder what debian has different in its Glibc files that limits.h is not included like it is for everybody else.

It works fine for me on Debian.

Quoted 6 lines

Anyway, of course it should be included where due. Gawd, that led me to have clean some unnecessary includes up beforehand, but oh well.

Could you try the "limits" branch of git://dev.medozas.de/iptables
if it compiles for you?

Unless Stephen has time to test this, I'll apply his patch. This doesn't seem worth loosing time over.

#4 lore raw
Quoted 4 lines · Patrick McHardy
Quoted 2 lines

I wonder what debian has different in its Glibc files that limits.h is not included like it is for everybody else.

It works fine for me on Debian.

Debian Glibc 2.9_3 also has limits.h removed from bits/socket.h.

Quoted 6 lines
Quoted 2 lines

Could you try the "limits" branch of git://dev.medozas.de/iptables
if it compiles for you?

Unless Stephen has time to test this, I'll apply his patch. This doesn't seem worth loosing time over.

Please do.

#5 lore raw
Quoted 5 lines · Jan Engelhardt
Quoted 3 lines · Patrick McHardy
Quoted 2 lines

I wonder what debian has different in its Glibc files that limits.h is not included like it is for everybody else.

It works fine for me on Debian.

Quoted 8 lines

Debian Glibc 2.9_3 also has limits.h removed from bits/socket.h.

Quoted 5 lines
Quoted 2 lines

Could you try the "limits" branch of git://dev.medozas.de/iptables
if it compiles for you?

Unless Stephen has time to test this, I'll apply his patch. This doesn't seem worth loosing time over.

Please do.

Applied, thanks.

#6 lore raw
Quoted 8 lines · Patrick McHardy
Quoted 7 lines · Jan Engelhardt
Quoted 3 lines · Patrick McHardy
Quoted 2 lines

I wonder what debian has different in its Glibc files that limits.h is not included like it is for everybody else.

It works fine for me on Debian.

Debian Glibc 2.9_3 also has limits.h removed from bits/socket.h.

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Could you try the "limits" branch of git://dev.medozas.de/iptables
if it compiles for you?

Unless Stephen has time to test this, I'll apply his patch. This doesn't seem worth loosing time over.

Please do.

Applied, thanks.

Ah crap. I misread "his patch" as "this patch". If you could slurp in the branch anwyay you will get the header resync and fixing up other places where <limits.h> might suddenly be missing.

Please apply.