From: Herbert Xu Date: Sun, 28 May 2006 06:06:33 +0000 (-0700) Subject: [IPSEC] xfrm: Use IPPROTO_MAX instead of 256 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=73654d61e556483ad324b90989eae26b22df6ef6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [IPSEC] xfrm: Use IPPROTO_MAX instead of 256 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 Signed-off-by: David S. Miller --- diff --git a/include/net/xfrm.h b/include/net/xfrm.h index ed5bb34f817f..9c5ee9f20b65 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -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);