aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_input.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-01 23:51:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-01 23:51:18 -0400
commitc46a024ea5eb0165114dbbc8c82c29b7bcf66e71 (patch)
treec91b0abf09c1fa5ddd566572dafa735aea05b592 /net/xfrm/xfrm_input.c
parent2459c6099b14b363e7212819a2d823cc167a1cd5 (diff)
parente453581dd518f60b45a8d2b9cf344e2a87d5267e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Various VTI tunnel (mark handling, PMTU) bug fixes from Alexander Duyck and Steffen Klassert. 2) Revert ethtool PHY query change, it wasn't correct. The PHY address selected by the driver running the PHY to MAC connection decides what PHY address GET ethtool operations return information from. 3) Fix handling of sequence number bits for encryption IV generation in ESP driver, from Herbert Xu. 4) UDP can return -EAGAIN when we hit a bad checksum on receive, even when there are other packets in the receive queue which is wrong. Just respect the error returned from the generic socket recv datagram helper. From Eric Dumazet. 5) Fix BNA driver firmware loading on big-endian systems, from Ivan Vecera. 6) Fix regression in that we were inheriting the congestion control of the listening socket for new connections, the intended behavior always was to use the default in this case. From Neal Cardwell. 7) Fix NULL deref in brcmfmac driver, from Arend van Spriel. 8) OTP parsing fix in iwlwifi from Liad Kaufman. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits) vti6: Add pmtu handling to vti6_xmit. Revert "net: core: 'ethtool' issue with querying phy settings" bnx2x: Move statistics implementation into semaphores xen: netback: read hotplug script once at start of day. xen: netback: fix printf format string warning Revert "netfilter: ensure number of counters is >0 in do_replace()" net: dsa: Properly propagate errors from dsa_switch_setup_one tcp: fix child sockets to use system default congestion control if not set udp: fix behavior of wrong checksums sfc: free multiple Rx buffers when required bna: fix soft lock-up during firmware initialization failure bna: remove unreasonable iocpf timer start bna: fix firmware loading on big-endian machines bridge: fix br_multicast_query_expired() bug via-rhine: Resigning as maintainer brcmfmac: avoid null pointer access when brcmf_msgbuf_get_pktid() fails mac80211: Fix mac80211.h docbook comments iwlwifi: nvm: fix otp parsing in 8000 hw family iwlwifi: pcie: fix tracking of cmd_in_flight ip_vti/ip6_vti: Preserve skb->mark after rcv_cb call ...
Diffstat (limited to 'net/xfrm/xfrm_input.c')
-rw-r--r--net/xfrm/xfrm_input.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 526c4feb3b50..b58286ecd156 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -13,6 +13,8 @@
13#include <net/dst.h> 13#include <net/dst.h>
14#include <net/ip.h> 14#include <net/ip.h>
15#include <net/xfrm.h> 15#include <net/xfrm.h>
16#include <net/ip_tunnels.h>
17#include <net/ip6_tunnel.h>
16 18
17static struct kmem_cache *secpath_cachep __read_mostly; 19static struct kmem_cache *secpath_cachep __read_mostly;
18 20
@@ -186,6 +188,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
186 struct xfrm_state *x = NULL; 188 struct xfrm_state *x = NULL;
187 xfrm_address_t *daddr; 189 xfrm_address_t *daddr;
188 struct xfrm_mode *inner_mode; 190 struct xfrm_mode *inner_mode;
191 u32 mark = skb->mark;
189 unsigned int family; 192 unsigned int family;
190 int decaps = 0; 193 int decaps = 0;
191 int async = 0; 194 int async = 0;
@@ -203,6 +206,18 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
203 XFRM_SPI_SKB_CB(skb)->daddroff); 206 XFRM_SPI_SKB_CB(skb)->daddroff);
204 family = XFRM_SPI_SKB_CB(skb)->family; 207 family = XFRM_SPI_SKB_CB(skb)->family;
205 208
209 /* if tunnel is present override skb->mark value with tunnel i_key */
210 if (XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4) {
211 switch (family) {
212 case AF_INET:
213 mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4->parms.i_key);
214 break;
215 case AF_INET6:
216 mark = be32_to_cpu(XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6->parms.i_key);
217 break;
218 }
219 }
220
206 /* Allocate new secpath or COW existing one. */ 221 /* Allocate new secpath or COW existing one. */
207 if (!skb->sp || atomic_read(&skb->sp->refcnt) != 1) { 222 if (!skb->sp || atomic_read(&skb->sp->refcnt) != 1) {
208 struct sec_path *sp; 223 struct sec_path *sp;
@@ -229,7 +244,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
229 goto drop; 244 goto drop;
230 } 245 }
231 246
232 x = xfrm_state_lookup(net, skb->mark, daddr, spi, nexthdr, family); 247 x = xfrm_state_lookup(net, mark, daddr, spi, nexthdr, family);
233 if (x == NULL) { 248 if (x == NULL) {
234 XFRM_INC_STATS(net, LINUX_MIB_XFRMINNOSTATES); 249 XFRM_INC_STATS(net, LINUX_MIB_XFRMINNOSTATES);
235 xfrm_audit_state_notfound(skb, family, spi, seq); 250 xfrm_audit_state_notfound(skb, family, spi, seq);