diff options
author | David S. Miller <davem@davemloft.net> | 2017-03-15 14:59:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-15 14:59:10 -0400 |
commit | 101c431492d297dd0d111b461d8d324895676bee (patch) | |
tree | 06d8a02a4fd91acdd6c31340452e85feaac4ecb7 /net/ipv6 | |
parent | 9c79ddaa0f962d1f26537a670b0652ff509a6fe0 (diff) | |
parent | 95422dec6bd4a7c57444743f7b1bb375335a6298 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/broadcom/genet/bcmgenet.c
net/core/sock.c
Conflicts were overlapping changes in bcmgenet and the
lockdep handling of sockets.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/af_inet6.c | 10 | ||||
-rw-r--r-- | net/ipv6/ip6_fib.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_offload.c | 4 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 9 | ||||
-rw-r--r-- | net/ipv6/ip6_vti.c | 8 | ||||
-rw-r--r-- | net/ipv6/route.c | 11 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 8 |
7 files changed, 34 insertions, 18 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 04db40620ea6..a9a9553ee63d 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -920,12 +920,12 @@ static int __init inet6_init(void) | |||
920 | err = register_pernet_subsys(&inet6_net_ops); | 920 | err = register_pernet_subsys(&inet6_net_ops); |
921 | if (err) | 921 | if (err) |
922 | goto register_pernet_fail; | 922 | goto register_pernet_fail; |
923 | err = icmpv6_init(); | ||
924 | if (err) | ||
925 | goto icmp_fail; | ||
926 | err = ip6_mr_init(); | 923 | err = ip6_mr_init(); |
927 | if (err) | 924 | if (err) |
928 | goto ipmr_fail; | 925 | goto ipmr_fail; |
926 | err = icmpv6_init(); | ||
927 | if (err) | ||
928 | goto icmp_fail; | ||
929 | err = ndisc_init(); | 929 | err = ndisc_init(); |
930 | if (err) | 930 | if (err) |
931 | goto ndisc_fail; | 931 | goto ndisc_fail; |
@@ -1061,10 +1061,10 @@ igmp_fail: | |||
1061 | ndisc_cleanup(); | 1061 | ndisc_cleanup(); |
1062 | ndisc_fail: | 1062 | ndisc_fail: |
1063 | ip6_mr_cleanup(); | 1063 | ip6_mr_cleanup(); |
1064 | ipmr_fail: | ||
1065 | icmpv6_cleanup(); | ||
1066 | icmp_fail: | 1064 | icmp_fail: |
1067 | unregister_pernet_subsys(&inet6_net_ops); | 1065 | unregister_pernet_subsys(&inet6_net_ops); |
1066 | ipmr_fail: | ||
1067 | icmpv6_cleanup(); | ||
1068 | register_pernet_fail: | 1068 | register_pernet_fail: |
1069 | sock_unregister(PF_INET6); | 1069 | sock_unregister(PF_INET6); |
1070 | rtnl_unregister_all(PF_INET6); | 1070 | rtnl_unregister_all(PF_INET6); |
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index e4266746e4a2..d4bf2c68a545 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -923,6 +923,8 @@ add: | |||
923 | ins = &rt->dst.rt6_next; | 923 | ins = &rt->dst.rt6_next; |
924 | iter = *ins; | 924 | iter = *ins; |
925 | while (iter) { | 925 | while (iter) { |
926 | if (iter->rt6i_metric > rt->rt6i_metric) | ||
927 | break; | ||
926 | if (rt6_qualify_for_ecmp(iter)) { | 928 | if (rt6_qualify_for_ecmp(iter)) { |
927 | *ins = iter->dst.rt6_next; | 929 | *ins = iter->dst.rt6_next; |
928 | fib6_purge_rt(iter, fn, info->nl_net); | 930 | fib6_purge_rt(iter, fn, info->nl_net); |
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c index 0838e6d01d2e..93e58a5e1837 100644 --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c | |||
@@ -294,8 +294,10 @@ static int ipv6_gro_complete(struct sk_buff *skb, int nhoff) | |||
294 | struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + nhoff); | 294 | struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + nhoff); |
295 | int err = -ENOSYS; | 295 | int err = -ENOSYS; |
296 | 296 | ||
297 | if (skb->encapsulation) | 297 | if (skb->encapsulation) { |
298 | skb_set_inner_protocol(skb, cpu_to_be16(ETH_P_IPV6)); | ||
298 | skb_set_inner_network_header(skb, nhoff); | 299 | skb_set_inner_network_header(skb, nhoff); |
300 | } | ||
299 | 301 | ||
300 | iph->payload_len = htons(skb->len - nhoff - sizeof(*iph)); | 302 | iph->payload_len = htons(skb->len - nhoff - sizeof(*iph)); |
301 | 303 | ||
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 528b3c1f3fde..58f6288e9ba5 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -768,13 +768,14 @@ slow_path: | |||
768 | * Fragment the datagram. | 768 | * Fragment the datagram. |
769 | */ | 769 | */ |
770 | 770 | ||
771 | *prevhdr = NEXTHDR_FRAGMENT; | ||
772 | troom = rt->dst.dev->needed_tailroom; | 771 | troom = rt->dst.dev->needed_tailroom; |
773 | 772 | ||
774 | /* | 773 | /* |
775 | * Keep copying data until we run out. | 774 | * Keep copying data until we run out. |
776 | */ | 775 | */ |
777 | while (left > 0) { | 776 | while (left > 0) { |
777 | u8 *fragnexthdr_offset; | ||
778 | |||
778 | len = left; | 779 | len = left; |
779 | /* IF: it doesn't fit, use 'mtu' - the data space left */ | 780 | /* IF: it doesn't fit, use 'mtu' - the data space left */ |
780 | if (len > mtu) | 781 | if (len > mtu) |
@@ -819,6 +820,10 @@ slow_path: | |||
819 | */ | 820 | */ |
820 | skb_copy_from_linear_data(skb, skb_network_header(frag), hlen); | 821 | skb_copy_from_linear_data(skb, skb_network_header(frag), hlen); |
821 | 822 | ||
823 | fragnexthdr_offset = skb_network_header(frag); | ||
824 | fragnexthdr_offset += prevhdr - skb_network_header(skb); | ||
825 | *fragnexthdr_offset = NEXTHDR_FRAGMENT; | ||
826 | |||
822 | /* | 827 | /* |
823 | * Build fragment header. | 828 | * Build fragment header. |
824 | */ | 829 | */ |
@@ -1385,7 +1390,7 @@ emsgsize: | |||
1385 | if ((((length + fragheaderlen) > mtu) || | 1390 | if ((((length + fragheaderlen) > mtu) || |
1386 | (skb && skb_is_gso(skb))) && | 1391 | (skb && skb_is_gso(skb))) && |
1387 | (sk->sk_protocol == IPPROTO_UDP) && | 1392 | (sk->sk_protocol == IPPROTO_UDP) && |
1388 | (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && | 1393 | (rt->dst.dev->features & NETIF_F_UFO) && !dst_xfrm(&rt->dst) && |
1389 | (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) { | 1394 | (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) { |
1390 | err = ip6_ufo_append_data(sk, queue, getfrag, from, length, | 1395 | err = ip6_ufo_append_data(sk, queue, getfrag, from, length, |
1391 | hh_len, fragheaderlen, exthdrlen, | 1396 | hh_len, fragheaderlen, exthdrlen, |
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index 644ba59fbd9d..3d8a3b63b4fd 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c | |||
@@ -485,11 +485,15 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) | |||
485 | if (!skb->ignore_df && skb->len > mtu) { | 485 | if (!skb->ignore_df && skb->len > mtu) { |
486 | skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu); | 486 | skb_dst(skb)->ops->update_pmtu(dst, NULL, skb, mtu); |
487 | 487 | ||
488 | if (skb->protocol == htons(ETH_P_IPV6)) | 488 | if (skb->protocol == htons(ETH_P_IPV6)) { |
489 | if (mtu < IPV6_MIN_MTU) | ||
490 | mtu = IPV6_MIN_MTU; | ||
491 | |||
489 | icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); | 492 | icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); |
490 | else | 493 | } else { |
491 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, | 494 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, |
492 | htonl(mtu)); | 495 | htonl(mtu)); |
496 | } | ||
493 | 497 | ||
494 | return -EMSGSIZE; | 498 | return -EMSGSIZE; |
495 | } | 499 | } |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 229bfcc451ef..35c58b669ebd 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -3299,7 +3299,6 @@ static size_t rt6_nlmsg_size(struct rt6_info *rt) | |||
3299 | nexthop_len = nla_total_size(0) /* RTA_MULTIPATH */ | 3299 | nexthop_len = nla_total_size(0) /* RTA_MULTIPATH */ |
3300 | + NLA_ALIGN(sizeof(struct rtnexthop)) | 3300 | + NLA_ALIGN(sizeof(struct rtnexthop)) |
3301 | + nla_total_size(16) /* RTA_GATEWAY */ | 3301 | + nla_total_size(16) /* RTA_GATEWAY */ |
3302 | + nla_total_size(4) /* RTA_OIF */ | ||
3303 | + lwtunnel_get_encap_size(rt->dst.lwtstate); | 3302 | + lwtunnel_get_encap_size(rt->dst.lwtstate); |
3304 | 3303 | ||
3305 | nexthop_len *= rt->rt6i_nsiblings; | 3304 | nexthop_len *= rt->rt6i_nsiblings; |
@@ -3323,7 +3322,7 @@ static size_t rt6_nlmsg_size(struct rt6_info *rt) | |||
3323 | } | 3322 | } |
3324 | 3323 | ||
3325 | static int rt6_nexthop_info(struct sk_buff *skb, struct rt6_info *rt, | 3324 | static int rt6_nexthop_info(struct sk_buff *skb, struct rt6_info *rt, |
3326 | unsigned int *flags) | 3325 | unsigned int *flags, bool skip_oif) |
3327 | { | 3326 | { |
3328 | if (!netif_running(rt->dst.dev) || !netif_carrier_ok(rt->dst.dev)) { | 3327 | if (!netif_running(rt->dst.dev) || !netif_carrier_ok(rt->dst.dev)) { |
3329 | *flags |= RTNH_F_LINKDOWN; | 3328 | *flags |= RTNH_F_LINKDOWN; |
@@ -3336,7 +3335,8 @@ static int rt6_nexthop_info(struct sk_buff *skb, struct rt6_info *rt, | |||
3336 | goto nla_put_failure; | 3335 | goto nla_put_failure; |
3337 | } | 3336 | } |
3338 | 3337 | ||
3339 | if (rt->dst.dev && | 3338 | /* not needed for multipath encoding b/c it has a rtnexthop struct */ |
3339 | if (!skip_oif && rt->dst.dev && | ||
3340 | nla_put_u32(skb, RTA_OIF, rt->dst.dev->ifindex)) | 3340 | nla_put_u32(skb, RTA_OIF, rt->dst.dev->ifindex)) |
3341 | goto nla_put_failure; | 3341 | goto nla_put_failure; |
3342 | 3342 | ||
@@ -3350,6 +3350,7 @@ nla_put_failure: | |||
3350 | return -EMSGSIZE; | 3350 | return -EMSGSIZE; |
3351 | } | 3351 | } |
3352 | 3352 | ||
3353 | /* add multipath next hop */ | ||
3353 | static int rt6_add_nexthop(struct sk_buff *skb, struct rt6_info *rt) | 3354 | static int rt6_add_nexthop(struct sk_buff *skb, struct rt6_info *rt) |
3354 | { | 3355 | { |
3355 | struct rtnexthop *rtnh; | 3356 | struct rtnexthop *rtnh; |
@@ -3362,7 +3363,7 @@ static int rt6_add_nexthop(struct sk_buff *skb, struct rt6_info *rt) | |||
3362 | rtnh->rtnh_hops = 0; | 3363 | rtnh->rtnh_hops = 0; |
3363 | rtnh->rtnh_ifindex = rt->dst.dev ? rt->dst.dev->ifindex : 0; | 3364 | rtnh->rtnh_ifindex = rt->dst.dev ? rt->dst.dev->ifindex : 0; |
3364 | 3365 | ||
3365 | if (rt6_nexthop_info(skb, rt, &flags) < 0) | 3366 | if (rt6_nexthop_info(skb, rt, &flags, true) < 0) |
3366 | goto nla_put_failure; | 3367 | goto nla_put_failure; |
3367 | 3368 | ||
3368 | rtnh->rtnh_flags = flags; | 3369 | rtnh->rtnh_flags = flags; |
@@ -3515,7 +3516,7 @@ static int rt6_fill_node(struct net *net, | |||
3515 | 3516 | ||
3516 | nla_nest_end(skb, mp); | 3517 | nla_nest_end(skb, mp); |
3517 | } else { | 3518 | } else { |
3518 | if (rt6_nexthop_info(skb, rt, &rtm->rtm_flags) < 0) | 3519 | if (rt6_nexthop_info(skb, rt, &rtm->rtm_flags, false) < 0) |
3519 | goto nla_put_failure; | 3520 | goto nla_put_failure; |
3520 | } | 3521 | } |
3521 | 3522 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 56f742fff967..c73a431fd06f 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -391,10 +391,12 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
391 | np = inet6_sk(sk); | 391 | np = inet6_sk(sk); |
392 | 392 | ||
393 | if (type == NDISC_REDIRECT) { | 393 | if (type == NDISC_REDIRECT) { |
394 | struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie); | 394 | if (!sock_owned_by_user(sk)) { |
395 | struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie); | ||
395 | 396 | ||
396 | if (dst) | 397 | if (dst) |
397 | dst->ops->redirect(dst, sk, skb); | 398 | dst->ops->redirect(dst, sk, skb); |
399 | } | ||
398 | goto out; | 400 | goto out; |
399 | } | 401 | } |
400 | 402 | ||