]> err.no Git - linux-2.6/commitdiff
[IPSEC] xfrm: Use IPPROTO_MAX instead of 256
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 28 May 2006 06:06:33 +0000 (23:06 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 18 Jun 2006 04:28:43 +0000 (21:28 -0700)
The size of the type_map array (256) comes from the number of IP protocols,
i.e., IPPROTO_MAX.  This patch is based on a suggestion from Ingo Oeser.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h

index ed5bb34f817fac5eb80835dd65323b4bb2660232..9c5ee9f20b65b7ef336652fc640331c67bc22c8f 100644 (file)
@@ -207,7 +207,7 @@ struct xfrm_type;
 struct xfrm_dst;
 struct xfrm_policy_afinfo {
        unsigned short          family;
-       struct xfrm_type        *type_map[256];
+       struct xfrm_type        *type_map[IPPROTO_MAX];
        struct xfrm_mode        *mode_map[XFRM_MODE_MAX];
        struct dst_ops          *dst_ops;
        void                    (*garbage_collect)(void);