diff options
author | Dmitry Safonov <dima@arista.com> | 2020-09-21 15:36:55 +0100 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2020-09-24 08:53:03 +0200 |
commit | 5106f4a8acff480e244300bc5097c0ad7048c3a2 (patch) | |
tree | 0f5319f64a61020eb78646b75ccdc6b52d424fe3 /include/net | |
parent | e11eb32de3a7854d6b366dee17dd36c9ab0c39de (diff) | |
download | linux-5106f4a8acff480e244300bc5097c0ad7048c3a2.tar.gz linux-5106f4a8acff480e244300bc5097c0ad7048c3a2.tar.bz2 linux-5106f4a8acff480e244300bc5097c0ad7048c3a2.zip |
xfrm/compat: Add 32=>64-bit messages translator
Provide the user-to-kernel translator under XFRM_USER_COMPAT, that
creates for 32-bit xfrm-user message a 64-bit translation.
The translation is afterwards reused by xfrm_user code just as if
userspace had sent 64-bit message.
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/xfrm.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 5b6cc62c9354..fa18cb6bb3f7 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -2001,11 +2001,17 @@ static inline int xfrm_tunnel_check(struct sk_buff *skb, struct xfrm_state *x, } extern const int xfrm_msg_min[XFRM_NR_MSGTYPES]; +extern const struct nla_policy xfrma_policy[XFRMA_MAX+1]; struct xfrm_translator { /* Allocate frag_list and put compat translation there */ int (*alloc_compat)(struct sk_buff *skb, const struct nlmsghdr *src); + /* Allocate nlmsg with 64-bit translaton of received 32-bit message */ + struct nlmsghdr *(*rcv_msg_compat)(const struct nlmsghdr *nlh, + int maxtype, const struct nla_policy *policy, + struct netlink_ext_ack *extack); + struct module *owner; }; |