tcp_timewait.c (235961) | tcp_timewait.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_timewait.c 235961 2012-05-25 02:23:26Z bz $"); | 33__FBSDID("$FreeBSD: head/sys/netinet/tcp_timewait.c 236170 2012-05-28 09:30:13Z bz $"); |
34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_tcpdebug.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/callout.h> --- 527 unchanged lines hidden (view full) --- 569 KASSERT(max_linkhdr + m->m_len <= MHLEN, ("tcptw: mbuf too small")); 570 571 th->th_seq = htonl(tw->snd_nxt); 572 th->th_ack = htonl(tw->rcv_nxt); 573 th->th_off = (sizeof(struct tcphdr) + optlen) >> 2; 574 th->th_flags = flags; 575 th->th_win = htons(tw->last_win); 576 | 34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_tcpdebug.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/callout.h> --- 527 unchanged lines hidden (view full) --- 569 KASSERT(max_linkhdr + m->m_len <= MHLEN, ("tcptw: mbuf too small")); 570 571 th->th_seq = htonl(tw->snd_nxt); 572 th->th_ack = htonl(tw->rcv_nxt); 573 th->th_off = (sizeof(struct tcphdr) + optlen) >> 2; 574 th->th_flags = flags; 575 th->th_win = htons(tw->last_win); 576 |
577 m->m_pkthdr.csum_flags = CSUM_TCP; | |
578 m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); 579#ifdef INET6 580 if (isipv6) { | 577 m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); 578#ifdef INET6 579 if (isipv6) { |
580 m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; |
|
581 th->th_sum = in6_cksum_pseudo(ip6, 582 sizeof(struct tcphdr) + optlen, IPPROTO_TCP, 0); 583 ip6->ip6_hlim = in6_selecthlim(inp, NULL); 584 error = ip6_output(m, inp->in6p_outputopts, NULL, 585 (tw->tw_so_options & SO_DONTROUTE), NULL, NULL, inp); 586 } 587#endif 588#if defined(INET6) && defined(INET) 589 else 590#endif 591#ifdef INET 592 { | 581 th->th_sum = in6_cksum_pseudo(ip6, 582 sizeof(struct tcphdr) + optlen, IPPROTO_TCP, 0); 583 ip6->ip6_hlim = in6_selecthlim(inp, NULL); 584 error = ip6_output(m, inp->in6p_outputopts, NULL, 585 (tw->tw_so_options & SO_DONTROUTE), NULL, NULL, inp); 586 } 587#endif 588#if defined(INET6) && defined(INET) 589 else 590#endif 591#ifdef INET 592 { |
593 m->m_pkthdr.csum_flags = CSUM_TCP; |
|
593 th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, 594 htons(sizeof(struct tcphdr) + optlen + IPPROTO_TCP)); 595 ip->ip_len = m->m_pkthdr.len; 596 if (V_path_mtu_discovery) 597 ip->ip_off |= IP_DF; 598 error = ip_output(m, inp->inp_options, NULL, 599 ((tw->tw_so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 600 NULL, inp); --- 47 unchanged lines hidden --- | 594 th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, 595 htons(sizeof(struct tcphdr) + optlen + IPPROTO_TCP)); 596 ip->ip_len = m->m_pkthdr.len; 597 if (V_path_mtu_discovery) 598 ip->ip_off |= IP_DF; 599 error = ip_output(m, inp->inp_options, NULL, 600 ((tw->tw_so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 601 NULL, inp); --- 47 unchanged lines hidden --- |