1. 11 Apr, 2009 1 commit
    • Vlad Yasevich's avatar
      ipv6: Fix NULL pointer dereference with time-wait sockets · 499923c7
      Vlad Yasevich authored
      Commit b2f5e7cd
      
      
      (ipv6: Fix conflict resolutions during ipv6 binding)
      introduced a regression where time-wait sockets were
      not treated correctly.  This resulted in the following:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000062
      IP: [<ffffffff805d7d61>] ipv4_rcv_saddr_equal+0x61/0x70
      ...
      Call Trace:
      [<ffffffffa033847b>] ipv6_rcv_saddr_equal+0x1bb/0x250 [ipv6]
      [<ffffffffa03505a8>] inet6_csk_bind_conflict+0x88/0xd0 [ipv6]
      [<ffffffff805bb18e>] inet_csk_get_port+0x1ee/0x400
      [<ffffffffa0319b7f>] inet6_bind+0x1cf/0x3a0 [ipv6]
      [<ffffffff8056d17c>] ? sockfd_lookup_light+0x3c/0xd0
      [<ffffffff8056ed49>] sys_bind+0x89/0x100
      [<ffffffff80613ea2>] ? trace_hardirqs_on_thunk+0x3a/0x3c
      [<ffffffff8020bf9b>] system_call_fastpath+0x16/0x1b
      Tested-by: default avatarBrian Haley <brian.haley@hp.com>
      Tested-by: default avatarEd Tomlinson <edt@aei.ca>
      Signed-off-by: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      499923c7
  2. 24 Mar, 2009 1 commit
  3. 16 Nov, 2008 1 commit
  4. 29 Oct, 2008 1 commit
    • Eric Dumazet's avatar
      udp: introduce struct udp_table and multiple spinlocks · 645ca708
      Eric Dumazet authored
      
      
      UDP sockets are hashed in a 128 slots hash table.
      
      This hash table is protected by *one* rwlock.
      
      This rwlock is readlocked each time an incoming UDP message is handled.
      
      This rwlock is writelocked each time a socket must be inserted in
      hash table (bind time), or deleted from this table (close time)
      
      This is not scalable on SMP machines :
      
      1) Even in read mode, lock() and unlock() are atomic operations and
       must dirty a contended cache line, shared by all cpus.
      
      2) A writer might be starved if many readers are 'in flight'. This can
       happen on a machine with some NIC receiving many UDP messages. User
       process can be delayed a long time at socket creation/dismantle time.
      
      This patch prepares RCU migration, by introducing 'struct udp_table
      and struct udp_hslot', and using one spinlock per chain, to reduce
      contention on central rwlock.
      
      Introducing one spinlock per chain reduces latencies, for port
      randomization on heavily loaded UDP servers. This also speedup
      bindings to specific ports.
      
      udp_lib_unhash() was uninlined, becoming to big.
      
      Some cleanups were done to ease review of following patch
      (RCUification of UDP Unicast lookups)
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      645ca708
  5. 07 Oct, 2008 2 commits
  6. 01 Oct, 2008 1 commit
  7. 18 Jul, 2008 2 commits
  8. 05 Jul, 2008 4 commits
  9. 13 Jun, 2008 1 commit
  10. 04 Jun, 2008 1 commit
  11. 31 Mar, 2008 1 commit
  12. 28 Mar, 2008 4 commits
  13. 22 Mar, 2008 1 commit
  14. 21 Mar, 2008 2 commits
  15. 28 Jan, 2008 3 commits
  16. 07 Jun, 2007 1 commit
  17. 11 May, 2007 1 commit
  18. 25 Apr, 2007 3 commits
  19. 04 Dec, 2006 1 commit
  20. 02 Dec, 2006 5 commits
    • Gerrit Renker's avatar
      [UDP(-Lite)]: consolidate v4 and v6 get|setsockopt code · 4c0a6cb0
      Gerrit Renker authored
      
      
      This patch consolidates set/getsockopt code between UDP(-Lite) v4 and 6. The
      justification is that UDP(-Lite) is a transport-layer protocol and therefore
      the socket option code (at least in theory) should be AF-independent.
      
      Furthermore, there is the following code reduplication:
       * do_udp{,v6}_getsockopt is 100% identical between v4 and v6
       * do_udp{,v6}_setsockopt is identical up to the following differerence
      	--v4 in contrast to v4 additionally allows the experimental encapsulation
                types  UDP_ENCAP_ESPINUDP and UDP_ENCAP_ESPINUDP_NON_IKE
      	--the remainder is identical between v4 and v6
         I believe that this difference is of little relevance.
      
      The advantages in not duplicating twice almost completely identical code.
      
      The patch further simplifies the interface of udp{,v6}_push_pending_frames,
      since for the second argument (struct udp_sock *up) it always holds that
      up = udp_sk(sk); where sk is the first function argument.
      Signed-off-by: default avatarGerrit Renker  <gerrit@erg.abdn.ac.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c0a6cb0
    • Al Viro's avatar
    • Al Viro's avatar
      b51655b9
    • Al Viro's avatar
      868c86bc
    • Gerrit Renker's avatar
      [NET]: Supporting UDP-Lite (RFC 3828) in Linux · ba4e58ec
      Gerrit Renker authored
      
      
      This is a revision of the previously submitted patch, which alters
      the way files are organized and compiled in the following manner:
      
      	* UDP and UDP-Lite now use separate object files
      	* source file dependencies resolved via header files
      	  net/ipv{4,6}/udp_impl.h
      	* order of inclusion files in udp.c/udplite.c adapted
      	  accordingly
      
      [NET/IPv4]: Support for the UDP-Lite protocol (RFC 3828)
      
      This patch adds support for UDP-Lite to the IPv4 stack, provided as an
      extension to the existing UDPv4 code:
              * generic routines are all located in net/ipv4/udp.c
              * UDP-Lite specific routines are in net/ipv4/udplite.c
              * MIB/statistics support in /proc/net/snmp and /proc/net/udplite
              * shared API with extensions for partial checksum coverage
      
      [NET/IPv6]: Extension for UDP-Lite over IPv6
      
      It extends the existing UDPv6 code base with support for UDP-Lite
      in the same manner as per UDPv4. In particular,
              * UDPv6 generic and shared code is in net/ipv6/udp.c
              * UDP-Litev6 specific extensions are in net/ipv6/udplite.c
              * MIB/statistics support in /proc/net/snmp6 and /proc/net/udplite6
              * support for IPV6_ADDRFORM
              * aligned the coding style of protocol initialisation with af_inet6.c
              * made the error handling in udpv6_queue_rcv_skb consistent;
                to return `-1' on error on all error cases
              * consolidation of shared code
      
      [NET]: UDP-Lite Documentation and basic XFRM/Netfilter support
      
      The UDP-Lite patch further provides
              * API documentation for UDP-Lite
              * basic xfrm support
              * basic netfilter support for IPv4 and IPv6 (LOG target)
      Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba4e58ec
  21. 22 Sep, 2006 2 commits
  22. 03 Jan, 2006 1 commit