Date: Thu, 21 May 2015 18:09:41 +0200 From: Luigi Rizzo <rizzo@iet.unipi.it> To: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Cc: Luigi Rizzo <rizzo@iet.unipi.it>, "Alexander V. Chernikov" <melifaro@freebsd.org> Subject: sys/netinet/ip_var.h: enum value exceeding 2^31-1 Message-ID: <CA%2BhQ2%2Bjg6H-nHTjRQpgc3vzhKAvWE7hd1zc0U6UwBNPSw9acEw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
in pedantic mode the compiler complains about
an enum value out of range (in sys/netinet/ip_var.h)
Would people object to the following change ?
It seems to be used internally only in a handful of places
+
/* ISO C restricts enumerator values to range of 'int'
+
* so we need
IPFW_INFO_
IN to have a smaller value
+
*/
enum {
IPFW_INFO_MASK = 0x0000ffff,
IPFW_INFO_OUT = 0x00000000, /* outgoing, just for convenience */
-
IPFW_INFO_IN = 0x8
00
00000, /* incoming, overloads dir */
+
IPFW_INFO_IN = 0x00800000, /* incoming, overloads dir */
IPFW_ONEPASS = 0x40000000, /* One-pass, do not reinject */
head/sys/netpfil/ipfw/ip_fw2.c: cmd->arg1 & ((i
& IPFW_INFO_IN) ? 1 : 2);
head/sys/netgraph/ng_ipfw.c: if (r->info & IPFW_INFO_IN) {
head/sys/netgraph/ng_ipfw.c: r->info |= dir ? IPFW_INFO_IN :
IPFW_INFO_OUT;
head/sys/netinet/ip_var.h: IPFW_INFO_IN = 0x80000000, /*
incoming, overloads dir */
head/sys/netinet/ip_divert.c: dt->info |= IPFW_IS_DIVERT |
IPFW_INFO_IN;
cheers
luigi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BhQ2%2Bjg6H-nHTjRQpgc3vzhKAvWE7hd1zc0U6UwBNPSw9acEw>
