1. 23 2月, 2011 1 次提交
  2. 21 2月, 2011 1 次提交
  3. 19 2月, 2011 1 次提交
  4. 18 2月, 2011 1 次提交
  5. 17 2月, 2011 1 次提交
  6. 11 2月, 2011 2 次提交
    • D
      inet: Create a mechanism for upward inetpeer propagation into routes. · 6431cbc2
      David S. Miller 提交于
      If we didn't have a routing cache, we would not be able to properly
      propagate certain kinds of dynamic path attributes, for example
      PMTU information and redirects.
      
      The reason is that if we didn't have a routing cache, then there would
      be no way to lookup all of the active cached routes hanging off of
      sockets, tunnels, IPSEC bundles, etc.
      
      Consider the case where we created a cached route, but no inetpeer
      entry existed and also we were not asked to pre-COW the route metrics
      and therefore did not force the creation a new inetpeer entry.
      
      If we later get a PMTU message, or a redirect, and store this
      information in a new inetpeer entry, there is no way to teach that
      cached route about the newly existing inetpeer entry.
      
      The facilities implemented here handle this problem.
      
      First we create a generation ID.  When we create a cached route of any
      kind, we remember the generation ID at the time of attachment.  Any
      time we force-create an inetpeer entry in response to new path
      information, we bump that generation ID.
      
      The dst_ops->check() callback is where the knowledge of this event
      is propagated.  If the global generation ID does not equal the one
      stored in the cached route, and the cached route has not attached
      to an inetpeer yet, we look it up and attach if one is found.  Now
      that we've updated the cached route's information, we update the
      route's generation ID too.
      
      This clears the way for implementing PMTU and redirects directly in
      the inetpeer cache.  There is absolutely no need to consult cached
      route information in order to maintain this information.
      
      At this point nothing bumps the inetpeer genids, that comes in the
      later changes which handle PMTUs and redirects using inetpeers.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6431cbc2
    • D
      inetpeer: Abstract address representation further. · 7a71ed89
      David S. Miller 提交于
      Future changes will add caching information, and some of
      these new elements will be addresses.
      
      Since the family is implicit via the ->daddr.family member,
      replicating the family in ever address we store is entirely
      redundant.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a71ed89
  7. 09 2月, 2011 1 次提交
  8. 05 2月, 2011 1 次提交
  9. 04 2月, 2011 1 次提交
  10. 01 2月, 2011 2 次提交
    • E
      net: Fix ipv6 neighbour unregister_sysctl_table warning · bf36076a
      Eric W. Biederman 提交于
      In my testing of 2.6.37 I was occassionally getting a warning about
      sysctl table entries being unregistered in the wrong order.  Digging
      in it turns out this dates back to the last great sysctl reorg done
      where Al Viro introduced the requirement that sysctl directories
      needed to be created before and destroyed after the files in them.
      
      It turns out that in that great reorg /proc/sys/net/ipv6/neigh was
      overlooked.  So this patch fixes that oversight and makes an annoying
      warning message go away.
      
      >------------[ cut here ]------------
      >WARNING: at kernel/sysctl.c:1992 unregister_sysctl_table+0x134/0x164()
      >Pid: 23951, comm: kworker/u:3 Not tainted 2.6.37-350888.2010AroraKernelBeta.fc14.x86_64 #1
      >Call Trace:
      > [<ffffffff8103e034>] warn_slowpath_common+0x80/0x98
      > [<ffffffff8103e061>] warn_slowpath_null+0x15/0x17
      > [<ffffffff810452f8>] unregister_sysctl_table+0x134/0x164
      > [<ffffffff810e7834>] ? kfree+0xc4/0xd1
      > [<ffffffff813439b2>] neigh_sysctl_unregister+0x22/0x3a
      > [<ffffffffa02cd14e>] addrconf_ifdown+0x33f/0x37b [ipv6]
      > [<ffffffff81331ec2>] ? skb_dequeue+0x5f/0x6b
      > [<ffffffffa02ce4a5>] addrconf_notify+0x69b/0x75c [ipv6]
      > [<ffffffffa02eb953>] ? ip6mr_device_event+0x98/0xa9 [ipv6]
      > [<ffffffff813d2413>] notifier_call_chain+0x32/0x5e
      > [<ffffffff8105bdea>] raw_notifier_call_chain+0xf/0x11
      > [<ffffffff8133cdac>] call_netdevice_notifiers+0x45/0x4a
      > [<ffffffff8133d2b0>] rollback_registered_many+0x118/0x201
      > [<ffffffff8133d3af>] unregister_netdevice_many+0x16/0x6d
      > [<ffffffff8133d571>] default_device_exit_batch+0xa4/0xb8
      > [<ffffffff81337c42>] ? cleanup_net+0x0/0x194
      > [<ffffffff81337a2a>] ops_exit_list+0x4e/0x56
      > [<ffffffff81337d36>] cleanup_net+0xf4/0x194
      > [<ffffffff81053318>] process_one_work+0x187/0x280
      > [<ffffffff8105441b>] worker_thread+0xff/0x19f
      > [<ffffffff8105431c>] ? worker_thread+0x0/0x19f
      > [<ffffffff8105776d>] kthread+0x7d/0x85
      > [<ffffffff81003824>] kernel_thread_helper+0x4/0x10
      > [<ffffffff810576f0>] ? kthread+0x0/0x85
      > [<ffffffff81003820>] ? kernel_thread_helper+0x0/0x10
      >---[ end trace 8a7e9310b35e9486 ]---
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf36076a
    • R
      net: Add default_mtu() methods to blackhole dst_ops · ec831ea7
      Roland Dreier 提交于
      When an IPSEC SA is still being set up, __xfrm_lookup() will return
      -EREMOTE and so ip_route_output_flow() will return a blackhole route.
      This can happen in a sndmsg call, and after d33e4553 ("net: Abstract
      default MTU metric calculation behind an accessor.") this leads to a
      crash in ip_append_data() because the blackhole dst_ops have no
      default_mtu() method and so dst_mtu() calls a NULL pointer.
      
      Fix this by adding default_mtu() methods (that simply return 0, matching
      the old behavior) to the blackhole dst_ops.
      
      The IPv4 part of this patch fixes a crash that I saw when using an IPSEC
      VPN; the IPv6 part is untested because I don't have an IPv6 VPN, but it
      looks to be needed as well.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec831ea7
  11. 28 1月, 2011 2 次提交
    • D
      net: Store ipv4/ipv6 COW'd metrics in inetpeer cache. · 06582540
      David S. Miller 提交于
      Please note that the IPSEC dst entry metrics keep using
      the generic metrics COW'ing mechanism using kmalloc/kfree.
      
      This gives the IPSEC routes an opportunity to use metrics
      which are unique to their encapsulated paths.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      06582540
    • D
      ipv6: Remove route peer binding assertions. · 8f2771f2
      David S. Miller 提交于
      They are bogus.  The basic idea is that I wanted to make sure
      that prefixed routes never bind to peers.
      
      The test I used was whether RTF_CACHE was set.
      
      But first of all, the RTF_CACHE flag is set at different spots
      depending upon which ip6_rt_copy() caller you're talking about.
      
      I've validated all of the code paths, and even in the future
      where we bind peers more aggressively (for route metric COW'ing)
      we never bind to prefix'd routes, only fully specified ones.
      This even applies when addrconf or icmp6 routes are allocated.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f2771f2
  12. 27 1月, 2011 2 次提交
    • D
      net: Implement read-only protection and COW'ing of metrics. · 62fa8a84
      David S. Miller 提交于
      Routing metrics are now copy-on-write.
      
      Initially a route entry points it's metrics at a read-only location.
      If a routing table entry exists, it will point there.  Else it will
      point at the all zero metric place-holder called 'dst_default_metrics'.
      
      The writeability state of the metrics is stored in the low bits of the
      metrics pointer, we have two bits left to spare if we want to store
      more states.
      
      For the initial implementation, COW is implemented simply via kmalloc.
      However future enhancements will change this to place the writable
      metrics somewhere else, in order to increase sharing.  Very likely
      this "somewhere else" will be the inetpeer cache.
      
      Note also that this means that metrics updates may transiently fail
      if we cannot COW the metrics successfully.
      
      But even by itself, this patch should decrease memory usage and
      increase cache locality especially for routing workloads.  In those
      cases the read-only metric copies stay in place and never get written
      to.
      
      TCP workloads where metrics get updated, and those rare cases where
      PMTU triggers occur, will take a very slight performance hit.  But
      that hit will be alleviated when the long-term writable metrics
      move to a more sharable location.
      
      Since the metrics storage went from a u32 array of RTAX_MAX entries to
      what is essentially a pointer, some retooling of the dst_entry layout
      was necessary.
      
      Most importantly, we need to preserve the alignment of the reference
      count so that it doesn't share cache lines with the read-mostly state,
      as per Eric Dumazet's alignment assertion checks.
      
      The only non-trivial bit here is the move of the 'flags' member into
      the writeable cacheline.  This is OK since we are always accessing the
      flags around the same moment when we made a modification to the
      reference count.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62fa8a84
    • D
      xfrm6: Don't forget to propagate peer into ipsec route. · 7cc2edb8
      David S. Miller 提交于
      Like ipv4, we have to propagate the ipv6 route peer into
      the ipsec top-level route during instantiation.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7cc2edb8
  13. 26 1月, 2011 1 次提交
  14. 25 1月, 2011 2 次提交
  15. 21 1月, 2011 3 次提交
  16. 19 1月, 2011 1 次提交
    • R
      ipv6: Silence privacy extensions initialization · 2fdc1c80
      Romain Francoise 提交于
      When a network namespace is created (via CLONE_NEWNET), the loopback
      interface is automatically added to the new namespace, triggering a
      printk in ipv6_add_dev() if CONFIG_IPV6_PRIVACY is set.
      
      This is problematic for applications which use CLONE_NEWNET as
      part of a sandbox, like Chromium's suid sandbox or recent versions of
      vsftpd. On a busy machine, it can lead to thousands of useless
      "lo: Disabled Privacy Extensions" messages appearing in dmesg.
      
      It's easy enough to check the status of privacy extensions via the
      use_tempaddr sysctl, so just removing the printk seems like the most
      sensible solution.
      Signed-off-by: NRomain Francoise <romain@orebokech.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2fdc1c80
  17. 13 1月, 2011 3 次提交
  18. 12 1月, 2011 2 次提交
  19. 11 1月, 2011 1 次提交
  20. 20 12月, 2010 1 次提交
  21. 19 12月, 2010 2 次提交
  22. 17 12月, 2010 3 次提交
    • S
      ipv6: don't flush routes when setting loopback down · 29ba5fed
      stephen hemminger 提交于
      When loopback device is being brought down, then keep the route table
      entries because they are special. The entries in the local table for
      linklocal routes and ::1 address should not be purged.
      
      This is a sub optimal solution to the problem and should be replaced
      by a better fix in future.
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Acked-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29ba5fed
    • O
      net: fix nulls list corruptions in sk_prot_alloc · fcbdf09d
      Octavian Purdila 提交于
      Special care is taken inside sk_port_alloc to avoid overwriting
      skc_node/skc_nulls_node. We should also avoid overwriting
      skc_bind_node/skc_portaddr_node.
      
      The patch fixes the following crash:
      
       BUG: unable to handle kernel paging request at fffffffffffffff0
       IP: [<ffffffff812ec6dd>] udp4_lib_lookup2+0xad/0x370
       [<ffffffff812ecc22>] __udp4_lib_lookup+0x282/0x360
       [<ffffffff812ed63e>] __udp4_lib_rcv+0x31e/0x700
       [<ffffffff812bba45>] ? ip_local_deliver_finish+0x65/0x190
       [<ffffffff812bbbf8>] ? ip_local_deliver+0x88/0xa0
       [<ffffffff812eda35>] udp_rcv+0x15/0x20
       [<ffffffff812bba45>] ip_local_deliver_finish+0x65/0x190
       [<ffffffff812bbbf8>] ip_local_deliver+0x88/0xa0
       [<ffffffff812bb2cd>] ip_rcv_finish+0x32d/0x6f0
       [<ffffffff8128c14c>] ? netif_receive_skb+0x99c/0x11c0
       [<ffffffff812bb94b>] ip_rcv+0x2bb/0x350
       [<ffffffff8128c14c>] netif_receive_skb+0x99c/0x11c0
      Signed-off-by: NLeonard Crestez <lcrestez@ixiacom.com>
      Signed-off-by: NOctavian Purdila <opurdila@ixiacom.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fcbdf09d
    • A
      ipv6: delete expired route in ip6_pmtu_deliver · d3052b55
      Andrey Vagin 提交于
      The first big packets sent to a "low-MTU" client correctly
      triggers the creation of a temporary route containing the reduced MTU.
      
      But after the temporary route has expired, new ICMP6 "packet too big"
      will be sent, rt6_pmtu_discovery will find the previous EXPIRED route
      check that its mtu isn't bigger then in icmp packet and do nothing
      before the temporary route will not deleted by gc.
      
      I make the simple experiment:
      while :; do
          time ( dd if=/dev/zero bs=10K count=1 | ssh hostname dd of=/dev/null ) || break;
      done
      
      The "time" reports real 0m0.197s if a temporary route isn't expired, but
      it reports real 0m52.837s (!!!!) immediately after a temporare route has
      expired.
      Signed-off-by: NAndrey Vagin <avagin@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d3052b55
  23. 16 12月, 2010 1 次提交
  24. 15 12月, 2010 1 次提交
  25. 14 12月, 2010 1 次提交
    • D
      net: Abstract default ADVMSS behind an accessor. · 0dbaee3b
      David S. Miller 提交于
      Make all RTAX_ADVMSS metric accesses go through a new helper function,
      dst_metric_advmss().
      
      Leave the actual default metric as "zero" in the real metric slot,
      and compute the actual default value dynamically via a new dst_ops
      AF specific callback.
      
      For stacked IPSEC routes, we use the advmss of the path which
      preserves existing behavior.
      
      Unlike ipv4/ipv6, DecNET ties the advmss to the mtu and thus updates
      advmss on pmtu updates.  This inconsistency in advmss handling
      results in more raw metric accesses than I wish we ended up with.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0dbaee3b
  26. 13 12月, 2010 2 次提交