Skip to content
Snippets Groups Projects
Select Git revision
  • 41c6d650f6537e55a1b53438c646fbc3f49176bf
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

tcp_ipv6.c

Blame
  • tcp_minisocks.c 24.85 KiB
    /*
     * INET		An implementation of the TCP/IP protocol suite for the LINUX
     *		operating system.  INET is implemented using the  BSD Socket
     *		interface as the means of communication with the user level.
     *
     *		Implementation of the Transmission Control Protocol(TCP).
     *
     * Authors:	Ross Biro
     *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
     *		Mark Evans, <evansmp@uhura.aston.ac.uk>
     *		Corey Minyard <wf-rch!minyard@relay.EU.net>
     *		Florian La Roche, <flla@stud.uni-sb.de>
     *		Charles Hedrick, <hedrick@klinzhai.rutgers.edu>
     *		Linus Torvalds, <torvalds@cs.helsinki.fi>
     *		Alan Cox, <gw4pts@gw4pts.ampr.org>
     *		Matthew Dillon, <dillon@apollo.west.oic.com>
     *		Arnt Gulbrandsen, <agulbra@nvg.unit.no>
     *		Jorge Cwik, <jorge@laser.satlink.net>
     */
    
    #include <linux/mm.h>
    #include <linux/module.h>
    #include <linux/slab.h>
    #include <linux/sysctl.h>
    #include <linux/workqueue.h>
    #include <net/tcp.h>
    #include <net/inet_common.h>
    #include <net/xfrm.h>
    
    int sysctl_tcp_syncookies __read_mostly = 1;
    EXPORT_SYMBOL(sysctl_tcp_syncookies);
    
    int sysctl_tcp_abort_on_overflow __read_mostly;
    
    struct inet_timewait_death_row tcp_death_row = {
    	.sysctl_max_tw_buckets = NR_FILE * 2,
    	.period		= TCP_TIMEWAIT_LEN / INET_TWDR_TWKILL_SLOTS,
    	.death_lock	= __SPIN_LOCK_UNLOCKED(tcp_death_row.death_lock),
    	.hashinfo	= &tcp_hashinfo,
    	.tw_timer	= TIMER_INITIALIZER(inet_twdr_hangman, 0,
    					    (unsigned long)&tcp_death_row),
    	.twkill_work	= __WORK_INITIALIZER(tcp_death_row.twkill_work,
    					     inet_twdr_twkill_work),
    /* Short-time timewait calendar */
    
    	.twcal_hand	= -1,
    	.twcal_timer	= TIMER_INITIALIZER(inet_twdr_twcal_tick, 0,
    					    (unsigned long)&tcp_death_row),
    };
    EXPORT_SYMBOL_GPL(tcp_death_row);
    
    static bool tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win)
    {
    	if (seq == s_win)
    		return true;
    	if (after(end_seq, s_win) && before(seq, e_win))
    		return true;
    	return seq == e_win && seq == end_seq;
    }
    
    /*
     * * Main purpose of TIME-WAIT state is to close connection gracefully,
     *   when one of ends sits in LAST-ACK or CLOSING retransmitting FIN
     *   (and, probably, tail of data) and one or more our ACKs are lost.
     * * What is TIME-WAIT timeout? It is associated with maximal packet
     *   lifetime in the internet, which results in wrong conclusion, that
     *   it is set to catch "old duplicate segments" wandering out of their path.
     *   It is not quite correct. This timeout is calculated so that it exceeds
     *   maximal retransmission timeout enough to allow to lose one (or more)
     *   segments sent by peer and our ACKs. This time may be calculated from RTO.