aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/xfrm.h5
-rw-r--r--net/xfrm/xfrm_user.c2
2 files changed, 5 insertions, 2 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/*
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 0d580ac19771..41f3d51ffc33 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -542,7 +542,7 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb)
542 info.nlmsg_flags = NLM_F_MULTI; 542 info.nlmsg_flags = NLM_F_MULTI;
543 info.this_idx = 0; 543 info.this_idx = 0;
544 info.start_idx = cb->args[0]; 544 info.start_idx = cb->args[0];
545 (void) xfrm_state_walk(IPSEC_PROTO_ANY, dump_one_state, &info); 545 (void) xfrm_state_walk(0, dump_one_state, &info);
546 cb->args[0] = info.this_idx; 546 cb->args[0] = info.this_idx;
547 547
548 return skb->len; 548 return skb->len;