1. 12 Feb, 2011 7 commits
  2. 11 Feb, 2011 19 commits
  3. 10 Feb, 2011 4 commits
    • David S. Miller's avatar
      inet: Create a mechanism for upward inetpeer propagation into routes. · 6431cbc2
      David S. Miller authored
      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: default avatarDavid S. Miller <davem@davemloft.net>
      6431cbc2
    • David S. Miller's avatar
      inetpeer: Add redirect and PMTU discovery cached info. · ddd4aa42
      David S. Miller authored
      Validity of the cached PMTU information is indicated by it's
      expiration value being non-zero, just as per dst->expires.
      
      The scheme we will use is that we will remember the pre-ICMP value
      held in the metrics or route entry, and then at expiration time
      we will restore that value.
      
      In this way PMTU expiration does not kill off the cached route as is
      done currently.
      
      Redirect information is permanent, or at least until another redirect
      is received.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ddd4aa42
    • David S. Miller's avatar
      inetpeer: Abstract address representation further. · 7a71ed89
      David S. Miller authored
      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: default avatarDavid S. Miller <davem@davemloft.net>
      7a71ed89
    • Xiaotian Feng's avatar
      net: rename group sysfs entry to netdev_group · b6644cb7
      Xiaotian Feng authored
      commit a512b92b adds sysfs entry for net device group, but
      before this commit, tun also uses group sysfs, so after this
      commit checkin, kernel warns like this:
          sysfs: cannot create duplicate filename '/devices/virtual/net/vnet0/group'
      
      Since tun has used this for years, rename sysfs under tun might
      break existing userspace, so rename group sysfs entry for net device
      group is a better choice.
      Signed-off-by: default avatarXiaotian Feng <dfeng@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6644cb7
  4. 09 Feb, 2011 6 commits
  5. 08 Feb, 2011 4 commits
    • David S. Miller's avatar
      net: Remove bogus barrier() in dst_allfrag(). · e7b66bdc
      David S. Miller authored
      I simply missed this one when modifying the other dst
      metric interfaces earlier.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7b66bdc
    • David S. Miller's avatar
      net: Fix lockdep regression caused by initializing netdev queues too early. · 8d3bdbd5
      David S. Miller authored
      In commit aa942104 ("net: init ingress
      queue") we moved the allocation and lock initialization of the queues
      into alloc_netdev_mq() since register_netdevice() is way too late.
      
      The problem is that dev->type is not setup until the setup()
      callback is invoked by alloc_netdev_mq(), and the dev->type is
      what determines the lockdep class to use for the locks in the
      queues.
      
      Fix this by doing the queue allocation after the setup() callback
      runs.
      
      This is safe because the setup() callback is not allowed to make any
      state changes that need to be undone on error (memory allocations,
      etc.).  It may, however, make state changes that are undone by
      free_netdev() (such as netif_napi_add(), which is done by the
      ipoib driver's setup routine).
      
      The previous code also leaked a reference to the &init_net namespace
      object on RX/TX queue allocation failures.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d3bdbd5
    • David S. Miller's avatar
      net/caif: Fix dangling list pointer in freed object on error. · b2df5a84
      David S. Miller authored
      rtnl_link_ops->setup(), and the "setup" callback passed to alloc_netdev*(),
      cannot make state changes which need to be undone on failure.  There is
      no cleanup mechanism available at this point.
      
      So we have to add the caif private instance to the global list once we
      are sure that register_netdev() has succedded in ->newlink().
      
      Otherwise, if register_netdev() fails, the caller will invoke free_netdev()
      and we will have a reference to freed up memory on the chnl_net_list.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b2df5a84
    • Nicolas Dichtel's avatar
      ipsec: allow to align IPv4 AH on 32 bits · fa9921e4
      Nicolas Dichtel authored
      The Linux IPv4 AH stack aligns the AH header on a 64 bit boundary
      (like in IPv6). This is not RFC compliant (see RFC4302, Section
      3.3.3.2.1), it should be aligned on 32 bits.
      
      For most of the authentication algorithms, the ICV size is 96 bits.
      The AH header alignment on 32 or 64 bits gives the same results.
      
      However for SHA-256-128 for instance, the wrong 64 bit alignment results
      in adding useless padding in IPv4 AH, which is forbidden by the RFC.
      
      To avoid breaking backward compatibility, we use a new flag
      (XFRM_STATE_ALIGN4) do change original behavior.
      
      Initial patch from Dang Hongwu <hongwu.dang@6wind.com> and
      Christophe Gouault <christophe.gouault@6wind.com>.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa9921e4