tcp_subr.c (235961) | tcp_subr.c (236170) |
---|---|
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 235961 2012-05-25 02:23:26Z bz $"); | 33__FBSDID("$FreeBSD: head/sys/netinet/tcp_subr.c 236170 2012-05-28 09:30:13Z bz $"); |
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> --- 572 unchanged lines hidden (view full) --- 614 nth->th_off = sizeof (struct tcphdr) >> 2; 615 nth->th_flags = flags; 616 if (tp != NULL) 617 nth->th_win = htons((u_short) (win >> tp->rcv_scale)); 618 else 619 nth->th_win = htons((u_short)win); 620 nth->th_urp = 0; 621 | 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> --- 572 unchanged lines hidden (view full) --- 614 nth->th_off = sizeof (struct tcphdr) >> 2; 615 nth->th_flags = flags; 616 if (tp != NULL) 617 nth->th_win = htons((u_short) (win >> tp->rcv_scale)); 618 else 619 nth->th_win = htons((u_short)win); 620 nth->th_urp = 0; 621 |
622 m->m_pkthdr.csum_flags = CSUM_TCP; | |
623 m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); 624#ifdef INET6 625 if (isipv6) { | 622 m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); 623#ifdef INET6 624 if (isipv6) { |
625 m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; |
|
626 nth->th_sum = in6_cksum_pseudo(ip6, 627 tlen - sizeof(struct ip6_hdr), IPPROTO_TCP, 0); 628 ip6->ip6_hlim = in6_selecthlim(tp != NULL ? tp->t_inpcb : 629 NULL, NULL); 630 } 631#endif /* INET6 */ 632#if defined(INET6) && defined(INET) 633 else 634#endif 635#ifdef INET 636 { | 626 nth->th_sum = in6_cksum_pseudo(ip6, 627 tlen - sizeof(struct ip6_hdr), IPPROTO_TCP, 0); 628 ip6->ip6_hlim = in6_selecthlim(tp != NULL ? tp->t_inpcb : 629 NULL, NULL); 630 } 631#endif /* INET6 */ 632#if defined(INET6) && defined(INET) 633 else 634#endif 635#ifdef INET 636 { |
637 m->m_pkthdr.csum_flags = CSUM_TCP; |
|
637 nth->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, 638 htons((u_short)(tlen - sizeof(struct ip) + ip->ip_p))); 639 } 640#endif /* INET */ 641#ifdef TCPDEBUG 642 if (tp == NULL || (inp->inp_socket->so_options & SO_DEBUG)) 643 tcp_trace(TA_OUTPUT, 0, tp, mtod(m, void *), th, 0); 644#endif --- 1668 unchanged lines hidden --- | 638 nth->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, 639 htons((u_short)(tlen - sizeof(struct ip) + ip->ip_p))); 640 } 641#endif /* INET */ 642#ifdef TCPDEBUG 643 if (tp == NULL || (inp->inp_socket->so_options & SO_DEBUG)) 644 tcp_trace(TA_OUTPUT, 0, tp, mtod(m, void *), th, 0); 645#endif --- 1668 unchanged lines hidden --- |