aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-06-02 01:33:25 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-02 01:51:30 -0400
commitdda922c831d1661c11a3ae1051b7160236f6ffb0 (patch)
tree2fe588dbc4dc90addaabf303713fb2c6af0dc19b /net/ipv6
parentdb3397b9aa30d334be237170e048dcd96e1e951d (diff)
parentc46a024ea5eb0165114dbbc8c82c29b7bcf66e71 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/phy/amd-xgbe-phy.c drivers/net/wireless/iwlwifi/Kconfig include/net/mac80211.h iwlwifi/Kconfig and mac80211.h were both trivial overlapping changes. The drivers/net/phy/amd-xgbe-phy.c file got removed in 'net-next' and the bug fix that happened on the 'net' side is already integrated into the rest of the amd-xgbe driver. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/esp6.c3
-rw-r--r--net/ipv6/ip6_vti.c27
-rw-r--r--net/ipv6/udp.c6
3 files changed, 28 insertions, 8 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 31f1b5d5e2ef..7c07ce36aae2 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -248,7 +248,8 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
248 aead_givcrypt_set_crypt(req, sg, sg, clen, iv); 248 aead_givcrypt_set_crypt(req, sg, sg, clen, iv);
249 aead_givcrypt_set_assoc(req, asg, assoclen); 249 aead_givcrypt_set_assoc(req, asg, assoclen);
250 aead_givcrypt_set_giv(req, esph->enc_data, 250 aead_givcrypt_set_giv(req, esph->enc_data,
251 XFRM_SKB_CB(skb)->seq.output.low); 251 XFRM_SKB_CB(skb)->seq.output.low +
252 ((u64)XFRM_SKB_CB(skb)->seq.output.hi << 32));
252 253
253 ESP_SKB_CB(skb)->tmp = tmp; 254 ESP_SKB_CB(skb)->tmp = tmp;
254 err = crypto_aead_givencrypt(req); 255 err = crypto_aead_givencrypt(req);
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index ed9d681207fa..0224c032dca5 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -322,7 +322,6 @@ static int vti6_rcv(struct sk_buff *skb)
322 } 322 }
323 323
324 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = t; 324 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = t;
325 skb->mark = be32_to_cpu(t->parms.i_key);
326 325
327 rcu_read_unlock(); 326 rcu_read_unlock();
328 327
@@ -342,6 +341,8 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err)
342 struct pcpu_sw_netstats *tstats; 341 struct pcpu_sw_netstats *tstats;
343 struct xfrm_state *x; 342 struct xfrm_state *x;
344 struct ip6_tnl *t = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6; 343 struct ip6_tnl *t = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6;
344 u32 orig_mark = skb->mark;
345 int ret;
345 346
346 if (!t) 347 if (!t)
347 return 1; 348 return 1;
@@ -358,7 +359,11 @@ static int vti6_rcv_cb(struct sk_buff *skb, int err)
358 x = xfrm_input_state(skb); 359 x = xfrm_input_state(skb);
359 family = x->inner_mode->afinfo->family; 360 family = x->inner_mode->afinfo->family;
360 361
361 if (!xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family)) 362 skb->mark = be32_to_cpu(t->parms.i_key);
363 ret = xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family);
364 skb->mark = orig_mark;
365
366 if (!ret)
362 return -EPERM; 367 return -EPERM;
363 368
364 skb_scrub_packet(skb, !net_eq(t->net, dev_net(skb->dev))); 369 skb_scrub_packet(skb, !net_eq(t->net, dev_net(skb->dev)));
@@ -430,6 +435,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
430 struct net_device *tdev; 435 struct net_device *tdev;
431 struct xfrm_state *x; 436 struct xfrm_state *x;
432 int err = -1; 437 int err = -1;
438 int mtu;
433 439
434 if (!dst) 440 if (!dst)
435 goto tx_err_link_failure; 441 goto tx_err_link_failure;
@@ -463,6 +469,19 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
463 skb_dst_set(skb, dst); 469 skb_dst_set(skb, dst);
464 skb->dev = skb_dst(skb)->dev; 470 skb->dev = skb_dst(skb)->dev;
465 471
472 mtu = dst_mtu(dst);
473 if (!skb->ignore_df && skb->len > mtu) {
474 skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu);
475
476 if (skb->protocol == htons(ETH_P_IPV6))
477 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
478 else
479 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
480 htonl(mtu));
481
482 return -EMSGSIZE;
483 }
484
466 err = dst_output(skb); 485 err = dst_output(skb);
467 if (net_xmit_eval(err) == 0) { 486 if (net_xmit_eval(err) == 0) {
468 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); 487 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
@@ -495,7 +514,6 @@ vti6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
495 int ret; 514 int ret;
496 515
497 memset(&fl, 0, sizeof(fl)); 516 memset(&fl, 0, sizeof(fl));
498 skb->mark = be32_to_cpu(t->parms.o_key);
499 517
500 switch (skb->protocol) { 518 switch (skb->protocol) {
501 case htons(ETH_P_IPV6): 519 case htons(ETH_P_IPV6):
@@ -516,6 +534,9 @@ vti6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
516 goto tx_err; 534 goto tx_err;
517 } 535 }
518 536
537 /* override mark with tunnel output key */
538 fl.flowi_mark = be32_to_cpu(t->parms.o_key);
539
519 ret = vti6_xmit(skb, dev, &fl); 540 ret = vti6_xmit(skb, dev, &fl);
520 if (ret < 0) 541 if (ret < 0)
521 goto tx_err; 542 goto tx_err;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index c2ec41617a35..e51fc3eee6db 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -525,10 +525,8 @@ csum_copy_err:
525 } 525 }
526 unlock_sock_fast(sk, slow); 526 unlock_sock_fast(sk, slow);
527 527
528 if (noblock) 528 /* starting over for a new packet, but check if we need to yield */
529 return -EAGAIN; 529 cond_resched();
530
531 /* starting over for a new packet */
532 msg->msg_flags &= ~MSG_TRUNC; 530 msg->msg_flags &= ~MSG_TRUNC;
533 goto try_again; 531 goto try_again;
534} 532}