tcp_subr.c (288412) | tcp_subr.c (289276) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet/tcp_subr.c 288412 2015-09-30 03:37:37Z glebius $"); | 33__FBSDID("$FreeBSD: head/sys/netinet/tcp_subr.c 289276 2015-10-14 00:35:37Z hiren $"); |
34 35#include "opt_compat.h" 36#include "opt_inet.h" 37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39#include "opt_tcpdebug.h" 40 41#include <sys/param.h> --- 45 unchanged lines hidden (view full) --- 87#include <netinet/tcp_seq.h> 88#include <netinet/tcp_timer.h> 89#include <netinet/tcp_var.h> 90#include <netinet/tcp_syncache.h> 91#ifdef INET6 92#include <netinet6/tcp6_var.h> 93#endif 94#include <netinet/tcpip.h> | 34 35#include "opt_compat.h" 36#include "opt_inet.h" 37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39#include "opt_tcpdebug.h" 40 41#include <sys/param.h> --- 45 unchanged lines hidden (view full) --- 87#include <netinet/tcp_seq.h> 88#include <netinet/tcp_timer.h> 89#include <netinet/tcp_var.h> 90#include <netinet/tcp_syncache.h> 91#ifdef INET6 92#include <netinet6/tcp6_var.h> 93#endif 94#include <netinet/tcpip.h> |
95#ifdef TCPPCAP 96#include <netinet/tcp_pcap.h> 97#endif |
|
95#ifdef TCPDEBUG 96#include <netinet/tcp_debug.h> 97#endif 98#ifdef INET6 99#include <netinet6/ip6protosw.h> 100#endif 101#ifdef TCP_OFFLOAD 102#include <netinet/tcp_offload.h> --- 319 unchanged lines hidden (view full) --- 422 panic("tcp_init"); 423#undef TCP_MINPROTOHDR 424 425 ISN_LOCK_INIT(); 426 EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL, 427 SHUTDOWN_PRI_DEFAULT); 428 EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL, 429 EVENTHANDLER_PRI_ANY); | 98#ifdef TCPDEBUG 99#include <netinet/tcp_debug.h> 100#endif 101#ifdef INET6 102#include <netinet6/ip6protosw.h> 103#endif 104#ifdef TCP_OFFLOAD 105#include <netinet/tcp_offload.h> --- 319 unchanged lines hidden (view full) --- 425 panic("tcp_init"); 426#undef TCP_MINPROTOHDR 427 428 ISN_LOCK_INIT(); 429 EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL, 430 SHUTDOWN_PRI_DEFAULT); 431 EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL, 432 EVENTHANDLER_PRI_ANY); |
433#ifdef TCPPCAP 434 tcp_pcap_init(); 435#endif |
|
430} 431 432#ifdef VIMAGE 433void 434tcp_destroy(void) 435{ 436 int error; 437 --- 389 unchanged lines hidden (view full) --- 827 tp->t_rcvtime = ticks; 828 /* 829 * IPv4 TTL initialization is necessary for an IPv6 socket as well, 830 * because the socket may be bound to an IPv6 wildcard address, 831 * which may match an IPv4-mapped IPv6 address. 832 */ 833 inp->inp_ip_ttl = V_ip_defttl; 834 inp->inp_ppcb = tp; | 436} 437 438#ifdef VIMAGE 439void 440tcp_destroy(void) 441{ 442 int error; 443 --- 389 unchanged lines hidden (view full) --- 833 tp->t_rcvtime = ticks; 834 /* 835 * IPv4 TTL initialization is necessary for an IPv6 socket as well, 836 * because the socket may be bound to an IPv6 wildcard address, 837 * which may match an IPv4-mapped IPv6 address. 838 */ 839 inp->inp_ip_ttl = V_ip_defttl; 840 inp->inp_ppcb = tp; |
841#ifdef TCPPCAP 842 /* 843 * Init the TCP PCAP queues. 844 */ 845 tcp_pcap_tcpcb_init(tp); 846#endif |
|
835 return (tp); /* XXX */ 836} 837 838/* 839 * Switch the congestion control algorithm back to NewReno for any active 840 * control blocks using an algorithm which is about to go away. 841 * This ensures the CC framework can allow the unload to proceed without leaving 842 * any dangling pointers which would trigger a panic. --- 168 unchanged lines hidden (view full) --- 1011#ifdef TCP_OFFLOAD 1012 /* Disconnect offload device, if any. */ 1013 if (tp->t_flags & TF_TOE) 1014 tcp_offload_detach(tp); 1015#endif 1016 1017 tcp_free_sackholes(tp); 1018 | 847 return (tp); /* XXX */ 848} 849 850/* 851 * Switch the congestion control algorithm back to NewReno for any active 852 * control blocks using an algorithm which is about to go away. 853 * This ensures the CC framework can allow the unload to proceed without leaving 854 * any dangling pointers which would trigger a panic. --- 168 unchanged lines hidden (view full) --- 1023#ifdef TCP_OFFLOAD 1024 /* Disconnect offload device, if any. */ 1025 if (tp->t_flags & TF_TOE) 1026 tcp_offload_detach(tp); 1027#endif 1028 1029 tcp_free_sackholes(tp); 1030 |
1031#ifdef TCPPCAP 1032 /* Free the TCP PCAP queues. */ 1033 tcp_pcap_drain(&(tp->t_inpkts)); 1034 tcp_pcap_drain(&(tp->t_outpkts)); 1035#endif 1036 |
|
1019 /* Allow the CC algorithm to clean up after itself. */ 1020 if (CC_ALGO(tp)->cb_destroy != NULL) 1021 CC_ALGO(tp)->cb_destroy(tp->ccv); 1022 1023 khelp_destroy_osd(tp->osd); 1024 1025 CC_ALGO(tp) = NULL; 1026 inp->inp_ppcb = NULL; --- 1497 unchanged lines hidden --- | 1037 /* Allow the CC algorithm to clean up after itself. */ 1038 if (CC_ALGO(tp)->cb_destroy != NULL) 1039 CC_ALGO(tp)->cb_destroy(tp->ccv); 1040 1041 khelp_destroy_osd(tp->osd); 1042 1043 CC_ALGO(tp) = NULL; 1044 inp->inp_ppcb = NULL; --- 1497 unchanged lines hidden --- |