summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-09-23 23:40:24 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-09-23 23:40:24 -0700
commitabb06375a5b6c7ab387e4d7a0b1c330b05c2ffec (patch)
tree721404e87c03463721958d2929eec8ecbfd2e75a /include
parentc932d4ad3dbe9752029a282cef77455ccc240d0e (diff)
parent869c392a217ba62afb53a5609563f97d4d8b92f5 (diff)
Merge "Merge android-4.4.193 (3edc5af) into msm-4.4"
Diffstat (limited to 'include')
-rw-r--r--include/net/xfrm.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 9e1325e36415..c5c03fa47f8c 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1304,6 +1304,23 @@ static inline int xfrm_state_kern(const struct xfrm_state *x)
return atomic_read(&x->tunnel_users);
}
+static inline bool xfrm_id_proto_valid(u8 proto)
+{
+ switch (proto) {
+ case IPPROTO_AH:
+ case IPPROTO_ESP:
+ case IPPROTO_COMP:
+#if IS_ENABLED(CONFIG_IPV6)
+ case IPPROTO_ROUTING:
+ case IPPROTO_DSTOPTS:
+#endif
+ return true;
+ default:
+ return false;
+ }
+}
+
+/* IPSEC_PROTO_ANY only matches 3 IPsec protocols, 0 could match all. */
static inline int xfrm_id_proto_match(u8 proto, u8 userproto)
{
return (!userproto || proto == userproto ||