diff options
author | David S. Miller <davem@davemloft.net> | 2016-09-12 18:52:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-12 18:52:44 -0400 |
commit | b20b378d49926b82c0a131492fa8842156e0e8a9 (patch) | |
tree | 7196847eea049a46442b05f99aee1dc571019381 /net/xfrm | |
parent | 02154927c115c7599677df57203988e05b576346 (diff) | |
parent | da499f8f5385c181e29978fdaab15a58de185302 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/mediatek/mtk_eth_soc.c
drivers/net/ethernet/qlogic/qed/qed_dcbx.c
drivers/net/phy/Kconfig
All conflicts were cases of overlapping commits.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_input.c | 14 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 4 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 13 |
3 files changed, 15 insertions, 16 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 1c4ad477ce93..6e3f0254d8a1 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c | |||
@@ -207,15 +207,15 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) | |||
207 | family = XFRM_SPI_SKB_CB(skb)->family; | 207 | family = XFRM_SPI_SKB_CB(skb)->family; |
208 | 208 | ||
209 | /* if tunnel is present override skb->mark value with tunnel i_key */ | 209 | /* if tunnel is present override skb->mark value with tunnel i_key */ |
210 | if (XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4) { | 210 | switch (family) { |
211 | switch (family) { | 211 | case AF_INET: |
212 | case AF_INET: | 212 | if (XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4) |
213 | mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4->parms.i_key); | 213 | mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4->parms.i_key); |
214 | break; | 214 | break; |
215 | case AF_INET6: | 215 | case AF_INET6: |
216 | if (XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6) | ||
216 | mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6->parms.i_key); | 217 | mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6->parms.i_key); |
217 | break; | 218 | break; |
218 | } | ||
219 | } | 219 | } |
220 | 220 | ||
221 | /* Allocate new secpath or COW existing one. */ | 221 | /* Allocate new secpath or COW existing one. */ |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index f7ce6265961a..fd6986634e6f 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -643,6 +643,10 @@ static void xfrm_hash_rebuild(struct work_struct *work) | |||
643 | 643 | ||
644 | /* re-insert all policies by order of creation */ | 644 | /* re-insert all policies by order of creation */ |
645 | list_for_each_entry_reverse(policy, &net->xfrm.policy_all, walk.all) { | 645 | list_for_each_entry_reverse(policy, &net->xfrm.policy_all, walk.all) { |
646 | if (xfrm_policy_id2dir(policy->index) >= XFRM_POLICY_MAX) { | ||
647 | /* skip socket policies */ | ||
648 | continue; | ||
649 | } | ||
646 | newpos = NULL; | 650 | newpos = NULL; |
647 | chain = policy_hash_bysel(net, &policy->selector, | 651 | chain = policy_hash_bysel(net, &policy->selector, |
648 | policy->family, | 652 | policy->family, |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index d516845e16e3..cb65d916a345 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -896,7 +896,8 @@ static int xfrm_dump_sa_done(struct netlink_callback *cb) | |||
896 | struct sock *sk = cb->skb->sk; | 896 | struct sock *sk = cb->skb->sk; |
897 | struct net *net = sock_net(sk); | 897 | struct net *net = sock_net(sk); |
898 | 898 | ||
899 | xfrm_state_walk_done(walk, net); | 899 | if (cb->args[0]) |
900 | xfrm_state_walk_done(walk, net); | ||
900 | return 0; | 901 | return 0; |
901 | } | 902 | } |
902 | 903 | ||
@@ -921,8 +922,6 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) | |||
921 | u8 proto = 0; | 922 | u8 proto = 0; |
922 | int err; | 923 | int err; |
923 | 924 | ||
924 | cb->args[0] = 1; | ||
925 | |||
926 | err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, | 925 | err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, |
927 | xfrma_policy); | 926 | xfrma_policy); |
928 | if (err < 0) | 927 | if (err < 0) |
@@ -939,6 +938,7 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) | |||
939 | proto = nla_get_u8(attrs[XFRMA_PROTO]); | 938 | proto = nla_get_u8(attrs[XFRMA_PROTO]); |
940 | 939 | ||
941 | xfrm_state_walk_init(walk, proto, filter); | 940 | xfrm_state_walk_init(walk, proto, filter); |
941 | cb->args[0] = 1; | ||
942 | } | 942 | } |
943 | 943 | ||
944 | (void) xfrm_state_walk(net, walk, dump_one_state, &info); | 944 | (void) xfrm_state_walk(net, walk, dump_one_state, &info); |
@@ -2051,9 +2051,6 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
2051 | if (up->hard) { | 2051 | if (up->hard) { |
2052 | xfrm_policy_delete(xp, p->dir); | 2052 | xfrm_policy_delete(xp, p->dir); |
2053 | xfrm_audit_policy_delete(xp, 1, true); | 2053 | xfrm_audit_policy_delete(xp, 1, true); |
2054 | } else { | ||
2055 | // reset the timers here? | ||
2056 | WARN(1, "Don't know what to do with soft policy expire\n"); | ||
2057 | } | 2054 | } |
2058 | km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); | 2055 | km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); |
2059 | 2056 | ||
@@ -2117,7 +2114,7 @@ static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
2117 | 2114 | ||
2118 | err = verify_newpolicy_info(&ua->policy); | 2115 | err = verify_newpolicy_info(&ua->policy); |
2119 | if (err) | 2116 | if (err) |
2120 | goto bad_policy; | 2117 | goto free_state; |
2121 | 2118 | ||
2122 | /* build an XP */ | 2119 | /* build an XP */ |
2123 | xp = xfrm_policy_construct(net, &ua->policy, attrs, &err); | 2120 | xp = xfrm_policy_construct(net, &ua->policy, attrs, &err); |
@@ -2149,8 +2146,6 @@ static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
2149 | 2146 | ||
2150 | return 0; | 2147 | return 0; |
2151 | 2148 | ||
2152 | bad_policy: | ||
2153 | WARN(1, "BAD policy passed\n"); | ||
2154 | free_state: | 2149 | free_state: |
2155 | kfree(x); | 2150 | kfree(x); |
2156 | nomem: | 2151 | nomem: |