mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says:
====================
1) Allow to avoid copying DSCP during encapsulation
by setting a SA flag. From Nicolas Dichtel.
2) Constify the netlink dispatch table, no need to modify it
at runtime. From Mathias Krause.
====================
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
commit
16e3d9648a
7 changed files with 32 additions and 6 deletions
|
|
@ -1187,6 +1187,7 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
|
|||
goto error;
|
||||
|
||||
x->props.flags = orig->props.flags;
|
||||
x->props.extra_flags = orig->props.extra_flags;
|
||||
|
||||
x->curlft.add_time = orig->curlft.add_time;
|
||||
x->km.state = orig->km.state;
|
||||
|
|
|
|||
|
|
@ -515,6 +515,9 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,
|
|||
|
||||
copy_from_user_state(x, p);
|
||||
|
||||
if (attrs[XFRMA_SA_EXTRA_FLAGS])
|
||||
x->props.extra_flags = nla_get_u32(attrs[XFRMA_SA_EXTRA_FLAGS]);
|
||||
|
||||
if ((err = attach_aead(&x->aead, &x->props.ealgo,
|
||||
attrs[XFRMA_ALG_AEAD])))
|
||||
goto error;
|
||||
|
|
@ -779,6 +782,13 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
|
|||
|
||||
copy_to_user_state(x, p);
|
||||
|
||||
if (x->props.extra_flags) {
|
||||
ret = nla_put_u32(skb, XFRMA_SA_EXTRA_FLAGS,
|
||||
x->props.extra_flags);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (x->coaddr) {
|
||||
ret = nla_put(skb, XFRMA_COADDR, sizeof(*x->coaddr), x->coaddr);
|
||||
if (ret)
|
||||
|
|
@ -2302,9 +2312,10 @@ static const struct nla_policy xfrma_policy[XFRMA_MAX+1] = {
|
|||
[XFRMA_MARK] = { .len = sizeof(struct xfrm_mark) },
|
||||
[XFRMA_TFCPAD] = { .type = NLA_U32 },
|
||||
[XFRMA_REPLAY_ESN_VAL] = { .len = sizeof(struct xfrm_replay_state_esn) },
|
||||
[XFRMA_SA_EXTRA_FLAGS] = { .type = NLA_U32 },
|
||||
};
|
||||
|
||||
static struct xfrm_link {
|
||||
static const struct xfrm_link {
|
||||
int (*doit)(struct sk_buff *, struct nlmsghdr *, struct nlattr **);
|
||||
int (*dump)(struct sk_buff *, struct netlink_callback *);
|
||||
int (*done)(struct netlink_callback *);
|
||||
|
|
@ -2338,7 +2349,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|||
{
|
||||
struct net *net = sock_net(skb->sk);
|
||||
struct nlattr *attrs[XFRMA_MAX+1];
|
||||
struct xfrm_link *link;
|
||||
const struct xfrm_link *link;
|
||||
int type, err;
|
||||
|
||||
type = nlh->nlmsg_type;
|
||||
|
|
@ -2495,6 +2506,8 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x)
|
|||
x->security->ctx_len);
|
||||
if (x->coaddr)
|
||||
l += nla_total_size(sizeof(*x->coaddr));
|
||||
if (x->props.extra_flags)
|
||||
l += nla_total_size(sizeof(x->props.extra_flags));
|
||||
|
||||
/* Must count x->lastused as it may become non-zero behind our back. */
|
||||
l += nla_total_size(sizeof(u64));
|
||||
|
|
|
|||
Loading…
Reference in a new issue