SCCS-vsn: sys/netinet/tcp_subr.c 7.19
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)tcp_subr.c 7.18 (Berkeley) %G%
+ * @(#)tcp_subr.c 7.19 (Berkeley) %G%
tcp_seq ack, seq;
int flags;
{
tcp_seq ack, seq;
int flags;
{
+ register int tlen;
+ int win = 0;
struct route *ro = 0;
if (tp) {
struct route *ro = 0;
if (tp) {
xchg(ti->ti_dport, ti->ti_sport, u_short);
#undef xchg
}
xchg(ti->ti_dport, ti->ti_sport, u_short);
#undef xchg
}
- m->m_len = sizeof (struct tcpiphdr) + tlen;
+ ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen));
+ tlen += sizeof (struct tcpiphdr);
+ m->m_len = tlen;
+ m->m_pkthdr.len = tlen;
+ m->m_pkthdr.rcvif = (struct ifnet *) 0;
ti->ti_next = ti->ti_prev = 0;
ti->ti_x1 = 0;
ti->ti_next = ti->ti_prev = 0;
ti->ti_x1 = 0;
- ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen));
ti->ti_seq = htonl(seq);
ti->ti_ack = htonl(ack);
ti->ti_x2 = 0;
ti->ti_seq = htonl(seq);
ti->ti_ack = htonl(ack);
ti->ti_x2 = 0;
ti->ti_flags = flags;
ti->ti_win = htons((u_short)win);
ti->ti_urp = 0;
ti->ti_flags = flags;
ti->ti_win = htons((u_short)win);
ti->ti_urp = 0;
- ti->ti_sum = in_cksum(m, sizeof (struct tcpiphdr) + tlen);
- ((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + tlen;
+ ti->ti_sum = in_cksum(m, tlen);
+ ((struct ip *)ti)->ip_len = tlen;
((struct ip *)ti)->ip_ttl = tcp_ttl;
(void) ip_output(m, (struct mbuf *)0, ro, 0);
}
((struct ip *)ti)->ip_ttl = tcp_ttl;
(void) ip_output(m, (struct mbuf *)0, ro, 0);
}