1. 01 Aug, 2014 4 commits
    • Tobias Klauser's avatar
      netlink: Use PAGE_ALIGNED macro · 74e83b23
      Tobias Klauser authored
      Use PAGE_ALIGNED(...) instead of IS_ALIGNED(..., PAGE_SIZE).
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      74e83b23
    • Duan Jiong's avatar
      net: fix the counter ICMP_MIB_INERRORS/ICMP6_MIB_INERRORS · 7304fe46
      Duan Jiong authored
      When dealing with ICMPv[46] Error Message, function icmp_socket_deliver()
      and icmpv6_notify() do some valid checks on packet's length, but then some
      protocols check packet's length redaudantly. So remove those duplicated
      statements, and increase counter ICMP_MIB_INERRORS/ICMP6_MIB_INERRORS in
      function icmp_socket_deliver() and icmpv6_notify() respectively.
      
      In addition, add missed counter in udp6/udplite6 when socket is NULL.
      Signed-off-by: default avatarDuan Jiong <duanj.fnst@cn.fujitsu.com>
      Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7304fe46
    • Jason Gunthorpe's avatar
      sctp: Fixup v4mapped behaviour to comply with Sock API · 299ee123
      Jason Gunthorpe authored
      The SCTP socket extensions API document describes the v4mapping option as
      follows:
      
      8.1.15.  Set/Clear IPv4 Mapped Addresses (SCTP_I_WANT_MAPPED_V4_ADDR)
      
         This socket option is a Boolean flag which turns on or off the
         mapping of IPv4 addresses.  If this option is turned on, then IPv4
         addresses will be mapped to V6 representation.  If this option is
         turned off, then no mapping will be done of V4 addresses and a user
         will receive both PF_INET6 and PF_INET type addresses on the socket.
         See [RFC3542] for more details on mapped V6 addresses.
      
      This description isn't really in line with what the code does though.
      
      Introduce addr_to_user (renamed addr_v4map), which should be called
      before any sockaddr is passed back to user space. The new function
      places the sockaddr into the correct format depending on the
      SCTP_I_WANT_MAPPED_V4_ADDR option.
      
      Audit all places that touched v4mapped and either sanely construct
      a v4 or v6 address then call addr_to_user, or drop the
      unnecessary v4mapped check entirely.
      
      Audit all places that call addr_to_user and verify they are on a sycall
      return path.
      
      Add a custom getname that formats the address properly.
      
      Several bugs are addressed:
       - SCTP_I_WANT_MAPPED_V4_ADDR=0 often returned garbage for
         addresses to user space
       - The addr_len returned from recvmsg was not correct when
         returning AF_INET on a v6 socket
       - flowlabel and scope_id were not zerod when promoting
         a v4 to v6
       - Some syscalls like bind and connect behaved differently
         depending on v4mapped
      
      Tested bind, getpeername, getsockname, connect, and recvmsg for proper
      behaviour in v4mapped = 1 and 0 cases.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Tested-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      299ee123
    • Karoly Kemeny's avatar
      net: kernel-doc compliant documentation for net_device · 536721b1
      Karoly Kemeny authored
      Net_device is a vast and important structure, but it has no kernel-doc
      compliant documentation. This patch extracts the comments from the structure
      to clean it up, and let the scripts extract documentation from it. I know that
      the patch is big, but it's just reordering of comments into the appropriate
      form, and adding a few more, for the missing members.
      Signed-off-by: default avatarKaroly Kemeny <karoly.kemeny@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      536721b1
  2. 31 Jul, 2014 33 commits
  3. 30 Jul, 2014 3 commits