X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=include%2Fnet%2Fxfrm.h;h=83eb033f2cc6556fecc87ab15478652f9034a603;hb=b19fd55296213ae5467ddd784e1fe8e2145fcf57;hp=ae35991b5877029b217a2b49fba7f012f193148c;hpb=4c470317f91e5e684201f21e237fe444ed47c18c;p=mirror_ubuntu-bionic-kernel.git diff --git a/include/net/xfrm.h b/include/net/xfrm.h index ae35991b5877..83eb033f2cc6 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -323,7 +323,6 @@ int xfrm_policy_register_afinfo(const struct xfrm_policy_afinfo *afinfo, int fam void xfrm_policy_unregister_afinfo(const struct xfrm_policy_afinfo *afinfo); void km_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c); -void xfrm_policy_cache_flush(void); void km_state_notify(struct xfrm_state *x, const struct km_event *c); struct xfrm_tmpl; @@ -1367,6 +1366,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 ||