1. 20 10月, 2009 1 次提交
    • E
      net: Fix IP_MULTICAST_IF · 55b80503
      Eric Dumazet 提交于
      ipv4/ipv6 setsockopt(IP_MULTICAST_IF) have dubious __dev_get_by_index() calls.
      
      This function should be called only with RTNL or dev_base_lock held, or reader
      could see a corrupt hash chain and eventually enter an endless loop.
      
      Fix is to call dev_get_by_index()/dev_put().
      
      If this happens to be performance critical, we could define a new dev_exist_by_index()
      function to avoid touching dev refcount.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55b80503
  2. 01 10月, 2009 1 次提交
  3. 14 8月, 2009 2 次提交
    • G
      inet6: Set default traffic class · 26ced1e4
      Gerrit Renker 提交于
      This patch addresses:
       * assigning -1 to np->tclass as it is currently done is not very meaningful,
         since it turns into 0xff;
       * RFC 3542, 6.5 allows -1 for clearing the sticky IPV6_TCLASS option
         and specifies -1 to mean "use kernel default":
         - RFC 2460, 7. requires that the default traffic class must be zero for
           all 8 bits,
         - this is consistent with RFC 2474, 4.1 which recommends a default PHB of 0,
           in combination with a value of the ECN field of "non-ECT" (RFC 3168, 5.).
      
      This patch changes the meaning of -1 from assigning 255 to mean the RFC 2460
      default, which at the same time allows to satisfy clearing the sticky TCLASS
      option as per RFC 3542, 6.5.
      
      (When passing -1 as ancillary data, the fallback remains np->tclass, which
       has either been set via socket options, or contains the default value.)
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26ced1e4
    • G
      inet6: Conversion from u8 to int · e651f03a
      Gerrit Renker 提交于
      This replaces assignments of the type "int on LHS" = "u8 on RHS" with
      simpler code. The LHS can express all of the unsigned right hand side
      values, hence the assigned value can not be negative.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e651f03a
  4. 14 4月, 2009 1 次提交
  5. 25 2月, 2009 1 次提交
  6. 05 1月, 2009 1 次提交
  7. 16 12月, 2008 2 次提交
    • Y
      ipv6: fix the return interface index when get it while no message is received · f250dcda
      Yang Hongyang 提交于
      When get receiving interface index while no message is received,
      the the value seted with setsockopt() should be returned.
      
      RFC 3542:
         Issuing getsockopt() for the above options will return the sticky
         option value i.e., the value set with setsockopt().  If no sticky
         option value has been set getsockopt() will return the following
         values:
      
         -  For the IPV6_PKTINFO option, it will return an in6_pktinfo
            structure with ipi6_addr being in6addr_any and ipi6_ifindex being
            zero.
      Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f250dcda
    • Y
      ipv6: Add IPV6_PKTINFO sticky option support to setsockopt() · b24a2516
      Yang Hongyang 提交于
      There are three reasons for me to add this support:
      1.When no interface is specified in an IPV6_PKTINFO ancillary data
        item, the interface specified in an IPV6_PKTINFO sticky optionis 
        is used.
      
      RFC3542:
      6.7.  Summary of Outgoing Interface Selection
      
         This document and [RFC-3493] specify various methods that affect the
         selection of the packet's outgoing interface.  This subsection
         summarizes the ordering among those in order to ensure deterministic
         behavior.
      
         For a given outgoing packet on a given socket, the outgoing interface
         is determined in the following order:
      
         1. if an interface is specified in an IPV6_PKTINFO ancillary data
            item, the interface is used.
      
         2. otherwise, if an interface is specified in an IPV6_PKTINFO sticky
            option, the interface is used.
      
      2.When no IPV6_PKTINFO ancillary data is received,getsockopt() should 
        return the sticky option value which set with setsockopt().
      
      RFC 3542:
         Issuing getsockopt() for the above options will return the sticky
         option value i.e., the value set with setsockopt().  If no sticky
         option value has been set getsockopt() will return the following
         values:
      
      3.Make the setsockopt implementation POSIX compliant.
      Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b24a2516
  8. 13 11月, 2008 1 次提交
    • B
      ipv6: routing header fixes · 6e093d9d
      Brian Haley 提交于
      This patch fixes two bugs:
      
      1. setsockopt() of anything but a Type 2 routing header should return
      EINVAL instead of EPERM.  Noticed by Shan Wei
      (shanwei@cn.fujitsu.com).
      
      2. setsockopt()/sendmsg() of a Type 2 routing header with invalid
      length or segments should return EINVAL.  These values are statically
      fixed in RFC 3775, unlike the variable Type 0 was.
      Signed-off-by: NBrian Haley <brian.haley@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6e093d9d
  9. 18 8月, 2008 1 次提交
  10. 04 8月, 2008 1 次提交
  11. 20 7月, 2008 1 次提交
  12. 19 7月, 2008 1 次提交
  13. 20 6月, 2008 1 次提交
  14. 12 6月, 2008 4 次提交
  15. 05 6月, 2008 5 次提交
  16. 01 5月, 2008 1 次提交
  17. 29 4月, 2008 1 次提交
  18. 28 4月, 2008 1 次提交
  19. 14 4月, 2008 1 次提交
  20. 12 4月, 2008 2 次提交
  21. 11 4月, 2008 1 次提交
    • Y
      [IPV6]: Sparse: Reuse previous delaration where appropriate. · a9f83bf3
      YOSHIFUJI Hideaki 提交于
      | net/ipv6/ipv6_sockglue.c:162:16: warning: symbol 'net' shadows an earlier one
      | net/ipv6/ipv6_sockglue.c:111:13: originally declared here
      | net/ipv6/ipv6_sockglue.c:175:16: warning: symbol 'net' shadows an earlier one
      | net/ipv6/ipv6_sockglue.c:111:13: originally declared here
      | net/ipv6/ip6mr.c:1241:10: warning: symbol 'ret' shadows an earlier one
      | net/ipv6/ip6mr.c:1163:6: originally declared here
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      a9f83bf3
  22. 05 4月, 2008 1 次提交
  23. 01 4月, 2008 1 次提交
  24. 26 3月, 2008 1 次提交
  25. 25 3月, 2008 2 次提交
  26. 08 3月, 2008 1 次提交
  27. 07 3月, 2008 1 次提交
    • D
      [UDP]: Revert udplite and code split. · db8dac20
      David S. Miller 提交于
      This reverts commit db1ed684 ("[IPV6]
      UDP: Rename IPv6 UDP files."), commit
      8be8af8f ("[IPV4] UDP: Move
      IPv4-specific bits to other file.") and commit
      e898d4db ("[UDP]: Allow users to
      configure UDP-Lite.").
      
      First, udplite is of such small cost, and it is a core protocol just
      like TCP and normal UDP are.
      
      We spent enormous amounts of effort to make udplite share as much code
      with core UDP as possible.  All of that work is less valuable if we're
      just going to slap a config option on udplite support.
      
      It is also causing build failures, as reported on linux-next, showing
      that the changeset was not tested very well.  In fact, this is the
      second build failure resulting from the udplite change.
      
      Finally, the config options provided was a bool, instead of a modular
      option.  Meaning the udplite code does not even get build tested
      by allmodconfig builds, and furthermore the user is not presented
      with a reasonable modular build option which is particularly needed
      by distribution vendors.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db8dac20
  28. 04 3月, 2008 2 次提交