summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2019-09-16 09:51:32 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2019-09-16 09:51:32 +0200
commit83f541302cae9c20bf3d64dfca4e093e61bb2aa4 (patch)
tree1be66d6c895531060eb07308415588d999a602c8 /include
parent72c5343cdbc5ec257e45d5387ed7220065c2ecff (diff)
parente19c5132f78a70cc53745558c0e728fecc74030a (diff)
Merge 4.4.193 into android-4.4-p
Changes in 4.4.193 ALSA: hda - Fix potential endless loop at applying quirks ALSA: hda/realtek - Fix overridden device-specific initialization xfrm: clean up xfrm protocol checks vhost/test: fix build for vhost test scripts/decode_stacktrace: match basepath using shell prefix operator, not regex clk: s2mps11: Add used attribute to s2mps11_dt_match x86, boot: Remove multiple copy of static function sanitize_boot_params() af_packet: tone down the Tx-ring unsupported spew. vhost: make sure log_num < in_num Linux 4.4.193 Change-Id: If2283bf8bc29f3deaf1c047c8ec9e502fbdf0521 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
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 ||