aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMasahide NAKAMURA <nakam@linux-ipv6.org>2006-08-23 20:49:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:06:32 -0400
commitdc00a525603650a1471c823a1e48c6505c2f9765 (patch)
tree5ea2b999a564daf2f6fb217db13859db702b4537 /include
parent5794708f11551b6d19b10673abf4b0202f66b44d (diff)
[XFRM] STATE: Allow non IPsec protocol.
It will be added two more transformation protocols (routing header and destination options header) for Mobile IPv6. xfrm_id_proto_match() can be handle zero as all, IPSEC_PROTO_ANY as all IPsec and otherwise as exact one. Based on MIPL2 kernel patch. Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/xfrm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 5b364b0a6a28..2a7d2132a1ae 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -838,7 +838,10 @@ static inline int xfrm_state_kern(struct xfrm_state *x)
838 838
839static inline int xfrm_id_proto_match(u8 proto, u8 userproto) 839static inline int xfrm_id_proto_match(u8 proto, u8 userproto)
840{ 840{
841 return (userproto == IPSEC_PROTO_ANY || proto == userproto); 841 return (!userproto || proto == userproto ||
842 (userproto == IPSEC_PROTO_ANY && (proto == IPPROTO_AH ||
843 proto == IPPROTO_ESP ||
844 proto == IPPROTO_COMP)));
842} 845}
843 846
844/* 847/*