tcp_reass.c (163606) | tcp_reass.c (165118) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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_input.c 8.12 (Berkeley) 5/24/95 | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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_input.c 8.12 (Berkeley) 5/24/95 |
30 * $FreeBSD: head/sys/netinet/tcp_reass.c 163606 2006-10-22 11:52:19Z rwatson $ | 30 * $FreeBSD: head/sys/netinet/tcp_reass.c 165118 2006-12-12 12:17:58Z bz $ |
31 */ 32 33#include "opt_ipfw.h" /* for ipfw_fwd */ 34#include "opt_inet.h" 35#include "opt_inet6.h" 36#include "opt_ipsec.h" 37#include "opt_mac.h" 38#include "opt_tcpdebug.h" --- 410 unchanged lines hidden (view full) --- 449#ifdef IPFIREWALL_FORWARD 450 struct m_tag *fwd_tag; 451#endif 452 int rstreason; /* For badport_bandlim accounting purposes */ 453 454 struct ip6_hdr *ip6 = NULL; 455#ifdef INET6 456 int isipv6; | 31 */ 32 33#include "opt_ipfw.h" /* for ipfw_fwd */ 34#include "opt_inet.h" 35#include "opt_inet6.h" 36#include "opt_ipsec.h" 37#include "opt_mac.h" 38#include "opt_tcpdebug.h" --- 410 unchanged lines hidden (view full) --- 449#ifdef IPFIREWALL_FORWARD 450 struct m_tag *fwd_tag; 451#endif 452 int rstreason; /* For badport_bandlim accounting purposes */ 453 454 struct ip6_hdr *ip6 = NULL; 455#ifdef INET6 456 int isipv6; |
457 char ip6buf[INET6_ADDRSTRLEN]; |
|
457#else 458 const int isipv6 = 0; 459#endif 460 461#ifdef TCPDEBUG 462 /* 463 * The size of tcp_saveipgen must be the size of the max ip header, 464 * now IPv6. --- 242 unchanged lines hidden (view full) --- 707#else 708 char dbuf[4*sizeof "123"], sbuf[4*sizeof "123"]; 709#endif 710 711 if (isipv6) { 712#ifdef INET6 713 strcpy(dbuf, "["); 714 strcpy(sbuf, "["); | 458#else 459 const int isipv6 = 0; 460#endif 461 462#ifdef TCPDEBUG 463 /* 464 * The size of tcp_saveipgen must be the size of the max ip header, 465 * now IPv6. --- 242 unchanged lines hidden (view full) --- 708#else 709 char dbuf[4*sizeof "123"], sbuf[4*sizeof "123"]; 710#endif 711 712 if (isipv6) { 713#ifdef INET6 714 strcpy(dbuf, "["); 715 strcpy(sbuf, "["); |
715 strcat(dbuf, ip6_sprintf(&ip6->ip6_dst)); 716 strcat(sbuf, ip6_sprintf(&ip6->ip6_src)); | 716 strcat(dbuf, 717 ip6_sprintf(ip6buf, &ip6->ip6_dst)); 718 strcat(sbuf, 719 ip6_sprintf(ip6buf, &ip6->ip6_src)); |
717 strcat(dbuf, "]"); 718 strcat(sbuf, "]"); 719#endif 720 } else { 721 strcpy(dbuf, inet_ntoa(ip->ip_dst)); 722 strcpy(sbuf, inet_ntoa(ip->ip_src)); 723 } 724 switch (log_in_vain) { --- 339 unchanged lines hidden (view full) --- 1064 tp->rcv_byps += tlen + off; 1065 if (tp->rcv_pps > tcp_minmssoverload) { 1066 if ((tp->rcv_byps / tp->rcv_pps) < tcp_minmss) { 1067 printf("too many small tcp packets from " 1068 "%s:%u, av. %lubyte/packet, " 1069 "dropping connection\n", 1070#ifdef INET6 1071 isipv6 ? | 720 strcat(dbuf, "]"); 721 strcat(sbuf, "]"); 722#endif 723 } else { 724 strcpy(dbuf, inet_ntoa(ip->ip_dst)); 725 strcpy(sbuf, inet_ntoa(ip->ip_src)); 726 } 727 switch (log_in_vain) { --- 339 unchanged lines hidden (view full) --- 1067 tp->rcv_byps += tlen + off; 1068 if (tp->rcv_pps > tcp_minmssoverload) { 1069 if ((tp->rcv_byps / tp->rcv_pps) < tcp_minmss) { 1070 printf("too many small tcp packets from " 1071 "%s:%u, av. %lubyte/packet, " 1072 "dropping connection\n", 1073#ifdef INET6 1074 isipv6 ? |
1072 ip6_sprintf(&inp->inp_inc.inc6_faddr) : | 1075 ip6_sprintf(ip6buf, 1076 &inp->inp_inc.inc6_faddr) : |
1073#endif 1074 inet_ntoa(inp->inp_inc.inc_faddr), 1075 inp->inp_inc.inc_fport, 1076 tp->rcv_byps / tp->rcv_pps); 1077 KASSERT(headlocked, ("tcp_input: " 1078 "after_listen: tcp_drop: head " 1079 "not locked")); 1080 tp = tcp_drop(tp, ECONNRESET); --- 2239 unchanged lines hidden --- | 1077#endif 1078 inet_ntoa(inp->inp_inc.inc_faddr), 1079 inp->inp_inc.inc_fport, 1080 tp->rcv_byps / tp->rcv_pps); 1081 KASSERT(headlocked, ("tcp_input: " 1082 "after_listen: tcp_drop: head " 1083 "not locked")); 1084 tp = tcp_drop(tp, ECONNRESET); --- 2239 unchanged lines hidden --- |