1. Nov 04, 2012
    • Eric Dumazet's avatar
      ipv4: avoid a test in ip_rt_put() · 6da025fa
      Eric Dumazet authored
      
      
      We can save a test in ip_rt_put(), considering dst_release() accepts
      a NULL parameter, and dst is first element in rtable.
      
      Add a BUILD_BUG_ON() to catch any change that could break this
      assertion.
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Cong Wang <amwang@redhat.com>
      Acked-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6da025fa
    • Neil Horman's avatar
      sctp: Clean up type-punning in sctp_cmd_t union · b26ddd81
      Neil Horman authored
      
      
      Lots of points in the sctp_cmd_interpreter function treat the sctp_cmd_t arg as
      a void pointer, even though they are written as various other types.  Theres no
      need for this as doing so just leads to possible type-punning issues that could
      cause crashes, and if we remain type-consistent we can actually just remove the
      void * member of the union entirely.
      
      Change Notes:
      
      v2)
      	* Dropped chunk that modified SCTP_NULL to create a marker pattern
      	 should anyone try to use a SCTP_NULL() assigned sctp_arg_t, Assigning
      	 to .zero provides the same effect and should be faster, per Vlad Y.
      
      v3)
      	* Reverted part of V2, opting to use memset instead of .zero, so that
      	 the entire union is initalized thus avoiding the i164 speculative load
      	 problems previously encountered, per Dave M..  Also rewrote
      	 SCTP_[NO]FORCE so as to use common infrastructure a little more
      
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: Vlad Yasevich <vyasevich@gmail.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: linux-sctp@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b26ddd81
    • Amerigo Wang's avatar
      ipv6: remove a useless NULL check · 1a940835
      Amerigo Wang authored
      
      
      In dev_forward_change(), it is useless to check if idev->dev
      is NULL, it is always non-NULL here.
      
      Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a940835
    • Daniel Borkmann's avatar
      pktgen: clean up ktime_t helpers · 398f382c
      Daniel Borkmann authored
      
      
      Some years ago, the ktime_t helper functions ktime_now() and ktime_lt()
      have been introduced. Instead of defining them inside pktgen.c, they
      should either use ktime_t library functions or, if not available, they
      should be defined in ktime.h, so that also others can benefit from them.
      ktime_compare() is introduced with a similar notion as in timespec_compare().
      
      Signed-off-by: default avatarDaniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      398f382c
    • Eric Dumazet's avatar
      tcp: better retrans tracking for defer-accept · e6c022a4
      Eric Dumazet authored
      
      
      For passive TCP connections using TCP_DEFER_ACCEPT facility,
      we incorrectly increment req->retrans each time timeout triggers
      while no SYNACK is sent.
      
      SYNACK are not sent for TCP_DEFER_ACCEPT that were established (for
      which we received the ACK from client). Only the last SYNACK is sent
      so that we can receive again an ACK from client, to move the req into
      accept queue. We plan to change this later to avoid the useless
      retransmit (and potential problem as this SYNACK could be lost)
      
      TCP_INFO later gives wrong information to user, claiming imaginary
      retransmits.
      
      Decouple req->retrans field into two independent fields :
      
      num_retrans : number of retransmit
      num_timeout : number of timeouts
      
      num_timeout is the counter that is incremented at each timeout,
      regardless of actual SYNACK being sent or not, and used to
      compute the exponential timeout.
      
      Introduce inet_rtx_syn_ack() helper to increment num_retrans
      only if ->rtx_syn_ack() succeeded.
      
      Use inet_rtx_syn_ack() from tcp_check_req() to increment num_retrans
      when we re-send a SYNACK in answer to a (retransmitted) SYN.
      Prior to this patch, we were not counting these retransmits.
      
      Change tcp_v[46]_rtx_synack() to increment TCP_MIB_RETRANSSEGS
      only if a synack packet was successfully queued.
      
      Reported-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Julian Anastasov <ja@ssi.bg>
      Cc: Vijay Subramanian <subramanian.vijay@gmail.com>
      Cc: Elliott Hughes <enh@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6c022a4
  2. Nov 03, 2012
  3. Nov 02, 2012
  4. Nov 01, 2012