aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-19 18:50:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-19 18:50:47 -0500
commit1ee2dcc2245340cf4ac94b99c4d00efbeba61824 (patch)
tree5339e55add987379525177011dde6e3756b1430c /net/ipv6/addrconf.c
parent4457e6f6c9f6052cd5f44a79037108b5ddeb0ce7 (diff)
parent091e0662ee2c37867ad918ce7b6ddd17f0e090e2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Mostly these are fixes for fallout due to merge window changes, as well as cures for problems that have been with us for a much longer period of time" 1) Johannes Berg noticed two major deficiencies in our genetlink registration. Some genetlink protocols we passing in constant counts for their ops array rather than something like ARRAY_SIZE(ops) or similar. Also, some genetlink protocols were using fixed IDs for their multicast groups. We have to retain these fixed IDs to keep existing userland tools working, but reserve them so that other multicast groups used by other protocols can not possibly conflict. In dealing with these two problems, we actually now use less state management for genetlink operations and multicast groups. 2) When configuring interface hardware timestamping, fix several drivers that simply do not validate that the hwtstamp_config value is one the driver actually supports. From Ben Hutchings. 3) Invalid memory references in mwifiex driver, from Amitkumar Karwar. 4) In dev_forward_skb(), set the skb->protocol in the right order relative to skb_scrub_packet(). From Alexei Starovoitov. 5) Bridge erroneously fails to use the proper wrapper functions to make calls to netdev_ops->ndo_vlan_rx_{add,kill}_vid. Fix from Toshiaki Makita. 6) When detaching a bridge port, make sure to flush all VLAN IDs to prevent them from leaking, also from Toshiaki Makita. 7) Put in a compromise for TCP Small Queues so that deep queued devices that delay TX reclaim non-trivially don't have such a performance decrease. One particularly problematic area is 802.11 AMPDU in wireless. From Eric Dumazet. 8) Fix crashes in tcp_fastopen_cache_get(), we can see NULL socket dsts here. Fix from Eric Dumzaet, reported by Dave Jones. 9) Fix use after free in ipv6 SIT driver, from Willem de Bruijn. 10) When computing mergeable buffer sizes, virtio-net fails to take the virtio-net header into account. From Michael Dalton. 11) Fix seqlock deadlock in ip4_datagram_connect() wrt. statistic bumping, this one has been with us for a while. From Eric Dumazet. 12) Fix NULL deref in the new TIPC fragmentation handling, from Erik Hugne. 13) 6lowpan bit used for traffic classification was wrong, from Jukka Rissanen. 14) macvlan has the same issue as normal vlans did wrt. propagating LRO disabling down to the real device, fix it the same way. From Michal Kubecek. 15) CPSW driver needs to soft reset all slaves during suspend, from Daniel Mack. 16) Fix small frame pacing in FQ packet scheduler, from Eric Dumazet. 17) The xen-netfront RX buffer refill timer isn't properly scheduled on partial RX allocation success, from Ma JieYue. 18) When ipv6 ping protocol support was added, the AF_INET6 protocol initialization cleanup path on failure was borked a little. Fix from Vlad Yasevich. 19) If a socket disconnects during a read/recvmsg/recvfrom/etc that blocks we can do the wrong thing with the msg_name we write back to userspace. From Hannes Frederic Sowa. There is another fix in the works from Hannes which will prevent future problems of this nature. 20) Fix route leak in VTI tunnel transmit, from Fan Du. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (106 commits) genetlink: make multicast groups const, prevent abuse genetlink: pass family to functions using groups genetlink: add and use genl_set_err() genetlink: remove family pointer from genl_multicast_group genetlink: remove genl_unregister_mc_group() hsr: don't call genl_unregister_mc_group() quota/genetlink: use proper genetlink multicast APIs drop_monitor/genetlink: use proper genetlink multicast APIs genetlink: only pass array to genl_register_family_with_ops() tcp: don't update snd_nxt, when a socket is switched from repair mode atm: idt77252: fix dev refcnt leak xfrm: Release dst if this dst is improper for vti tunnel netlink: fix documentation typo in netlink_set_err() be2net: Delete secondary unicast MAC addresses during be_close be2net: Fix unconditional enabling of Rx interface options net, virtio_net: replace the magic value ping: prevent NULL pointer dereference on write to msg_name bnx2x: Prevent "timeout waiting for state X" bnx2x: prevent CFC attention bnx2x: Prevent panic during DMAE timeout ...
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c38
1 files changed, 9 insertions, 29 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 5658d9d51637..12c97d8aa6bb 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1996,23 +1996,6 @@ static void addrconf_add_mroute(struct net_device *dev)
1996 ip6_route_add(&cfg); 1996 ip6_route_add(&cfg);
1997} 1997}
1998 1998
1999#if IS_ENABLED(CONFIG_IPV6_SIT)
2000static void sit_route_add(struct net_device *dev)
2001{
2002 struct fib6_config cfg = {
2003 .fc_table = RT6_TABLE_MAIN,
2004 .fc_metric = IP6_RT_PRIO_ADDRCONF,
2005 .fc_ifindex = dev->ifindex,
2006 .fc_dst_len = 96,
2007 .fc_flags = RTF_UP | RTF_NONEXTHOP,
2008 .fc_nlinfo.nl_net = dev_net(dev),
2009 };
2010
2011 /* prefix length - 96 bits "::d.d.d.d" */
2012 ip6_route_add(&cfg);
2013}
2014#endif
2015
2016static struct inet6_dev *addrconf_add_dev(struct net_device *dev) 1999static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
2017{ 2000{
2018 struct inet6_dev *idev; 2001 struct inet6_dev *idev;
@@ -2542,7 +2525,8 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
2542 struct in6_addr addr; 2525 struct in6_addr addr;
2543 struct net_device *dev; 2526 struct net_device *dev;
2544 struct net *net = dev_net(idev->dev); 2527 struct net *net = dev_net(idev->dev);
2545 int scope; 2528 int scope, plen;
2529 u32 pflags = 0;
2546 2530
2547 ASSERT_RTNL(); 2531 ASSERT_RTNL();
2548 2532
@@ -2552,12 +2536,16 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
2552 if (idev->dev->flags&IFF_POINTOPOINT) { 2536 if (idev->dev->flags&IFF_POINTOPOINT) {
2553 addr.s6_addr32[0] = htonl(0xfe800000); 2537 addr.s6_addr32[0] = htonl(0xfe800000);
2554 scope = IFA_LINK; 2538 scope = IFA_LINK;
2539 plen = 64;
2555 } else { 2540 } else {
2556 scope = IPV6_ADDR_COMPATv4; 2541 scope = IPV6_ADDR_COMPATv4;
2542 plen = 96;
2543 pflags |= RTF_NONEXTHOP;
2557 } 2544 }
2558 2545
2559 if (addr.s6_addr32[3]) { 2546 if (addr.s6_addr32[3]) {
2560 add_addr(idev, &addr, 128, scope); 2547 add_addr(idev, &addr, plen, scope);
2548 addrconf_prefix_route(&addr, plen, idev->dev, 0, pflags);
2561 return; 2549 return;
2562 } 2550 }
2563 2551
@@ -2569,7 +2557,6 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
2569 int flag = scope; 2557 int flag = scope;
2570 2558
2571 for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) { 2559 for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
2572 int plen;
2573 2560
2574 addr.s6_addr32[3] = ifa->ifa_local; 2561 addr.s6_addr32[3] = ifa->ifa_local;
2575 2562
@@ -2580,12 +2567,10 @@ static void sit_add_v4_addrs(struct inet6_dev *idev)
2580 continue; 2567 continue;
2581 flag |= IFA_HOST; 2568 flag |= IFA_HOST;
2582 } 2569 }
2583 if (idev->dev->flags&IFF_POINTOPOINT)
2584 plen = 64;
2585 else
2586 plen = 96;
2587 2570
2588 add_addr(idev, &addr, plen, flag); 2571 add_addr(idev, &addr, plen, flag);
2572 addrconf_prefix_route(&addr, plen, idev->dev, 0,
2573 pflags);
2589 } 2574 }
2590 } 2575 }
2591 } 2576 }
@@ -2711,7 +2696,6 @@ static void addrconf_sit_config(struct net_device *dev)
2711 struct in6_addr addr; 2696 struct in6_addr addr;
2712 2697
2713 ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0); 2698 ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0);
2714 addrconf_prefix_route(&addr, 64, dev, 0, 0);
2715 if (!ipv6_generate_eui64(addr.s6_addr + 8, dev)) 2699 if (!ipv6_generate_eui64(addr.s6_addr + 8, dev))
2716 addrconf_add_linklocal(idev, &addr); 2700 addrconf_add_linklocal(idev, &addr);
2717 return; 2701 return;
@@ -2721,8 +2705,6 @@ static void addrconf_sit_config(struct net_device *dev)
2721 2705
2722 if (dev->flags&IFF_POINTOPOINT) 2706 if (dev->flags&IFF_POINTOPOINT)
2723 addrconf_add_mroute(dev); 2707 addrconf_add_mroute(dev);
2724 else
2725 sit_route_add(dev);
2726} 2708}
2727#endif 2709#endif
2728 2710
@@ -2740,8 +2722,6 @@ static void addrconf_gre_config(struct net_device *dev)
2740 } 2722 }
2741 2723
2742 ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0); 2724 ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0);
2743 addrconf_prefix_route(&addr, 64, dev, 0, 0);
2744
2745 if (!ipv6_generate_eui64(addr.s6_addr + 8, dev)) 2725 if (!ipv6_generate_eui64(addr.s6_addr + 8, dev))
2746 addrconf_add_linklocal(idev, &addr); 2726 addrconf_add_linklocal(idev, &addr);
2747} 2727}