summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2003-02-19 22:18:06 +0000
committerjlemon <jlemon@FreeBSD.org>2003-02-19 22:18:06 +0000
commit79a1ebfa6f53d733dc4775c2031ff3d16e53b75c (patch)
tree8563c7bec384ef864223fce476020ed3fb16ccd9 /sys/netinet/tcp_output.c
parent6ececd4417e9635c5b55583283f2640c2fb05a6b (diff)
downloadFreeBSD-src-79a1ebfa6f53d733dc4775c2031ff3d16e53b75c.zip
FreeBSD-src-79a1ebfa6f53d733dc4775c2031ff3d16e53b75c.tar.gz
Convert tcp_fillheaders(tp, ...) -> tcpip_fillheaders(inp, ...) so the
routine does not require a tcpcb to operate. Since we no longer keep template mbufs around, move pseudo checksum out of this routine, and merge it with the length update. Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index a917ed3..2cb6acf 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -674,15 +674,14 @@ send:
if (isipv6) {
ip6 = mtod(m, struct ip6_hdr *);
th = (struct tcphdr *)(ip6 + 1);
- tcp_fillheaders(tp, ip6, th);
+ tcpip_fillheaders(tp->t_inpcb, ip6, th);
} else
#endif /* INET6 */
{
ip = mtod(m, struct ip *);
ipov = (struct ipovly *)ip;
th = (struct tcphdr *)(ip + 1);
- /* this picks up the pseudo header (w/o the length) */
- tcp_fillheaders(tp, ip, th);
+ tcpip_fillheaders(tp->t_inpcb, ip, th);
}
/*
@@ -772,9 +771,8 @@ send:
{
m->m_pkthdr.csum_flags = CSUM_TCP;
m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
- if (len + optlen)
- th->th_sum = in_addword(th->th_sum,
- htons((u_short)(optlen + len)));
+ th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
+ htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen));
/* IP version must be set here for ipv4/ipv6 checking later */
KASSERT(ip->ip_v == IPVERSION,
@@ -894,10 +892,7 @@ send:
tp->t_inpcb->in6p_route.ro_rt ?
tp->t_inpcb->in6p_route.ro_rt->rt_ifp
: NULL);
- else
#endif /* INET6 */
- ip->ip_ttl = tp->t_inpcb->inp_ip_ttl; /* XXX */
- ip->ip_tos = tp->t_inpcb->inp_ip_tos; /* XXX */
/*
* See if we should do MTU discovery. We do it only if the following
* are true:
OpenPOWER on IntegriCloud