* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* TCP input routine, follows pages 65-76 of the
* protocol specification dated September, 1981 very closely.
*/
* TCP input routine, follows pages 65-76 of the
* protocol specification dated September, 1981 very closely.
*/
- if (((struct ip *)ti)->ip_hl > (sizeof (struct ip) >> 2))
- ip_stripoptions((struct ip *)ti, (struct mbuf *)0);
- if (m->m_off > MMAXOFF || m->m_len < sizeof (struct tcpiphdr)) {
+ if (iphlen > sizeof (struct ip))
+ ip_stripoptions(m, (struct mbuf *)0);
+ if (m->m_flags & M_EXT || m->m_len < sizeof (struct tcpiphdr)) {
- if (tcpcksum) {
- ti->ti_next = ti->ti_prev = 0;
- ti->ti_x1 = 0;
- ti->ti_len = (u_short)tlen;
- ti->ti_len = htons((u_short)ti->ti_len);
- if (ti->ti_sum = in_cksum(m, len)) {
- if (tcpprintfs)
- printf("tcp sum: src %x\n", ti->ti_src);
- tcpstat.tcps_rcvbadsum++;
- goto drop;
- }
+ ti->ti_next = ti->ti_prev = 0;
+ ti->ti_x1 = 0;
+ ti->ti_len = (u_short)tlen;
+ ti->ti_len = htons((u_short)ti->ti_len);
+ if (ti->ti_sum = in_cksum(m, len)) {
+ if (tcpprintfs)
+ printf("tcp sum: src %x\n", ti->ti_src);
+ tcpstat.tcps_rcvbadsum++;
+ goto drop;
{ caddr_t op = mtod(m, caddr_t) + sizeof (struct tcpiphdr);
bcopy(op, mtod(om, caddr_t), (unsigned)om->m_len);
m->m_len -= om->m_len;
{ caddr_t op = mtod(m, caddr_t) + sizeof (struct tcpiphdr);
bcopy(op, mtod(om, caddr_t), (unsigned)om->m_len);
m->m_len -= om->m_len;
(void) tcp_reass(tp, (struct tcpiphdr *)0);
/*
* if we didn't have to retransmit the SYN,
(void) tcp_reass(tp, (struct tcpiphdr *)0);
/*
* if we didn't have to retransmit the SYN,
(void) tcp_reass(tp, (struct tcpiphdr *)0);
tp->snd_wl1 = ti->ti_seq - 1;
/* fall into ... */
(void) tcp_reass(tp, (struct tcpiphdr *)0);
tp->snd_wl1 = ti->ti_seq - 1;
/* fall into ... */
tp->snd_una = ti->ti_ack;
if (SEQ_LT(tp->snd_nxt, tp->snd_una))
tp->snd_nxt = tp->snd_una;
tp->snd_una = ti->ti_ack;
if (SEQ_LT(tp->snd_nxt, tp->snd_una))
tp->snd_nxt = tp->snd_una;
* Make ACK acceptable to originator of segment.
* Don't bother to respond if destination was broadcast.
*/
* Make ACK acceptable to originator of segment.
* Don't bother to respond if destination was broadcast.
*/
- tcp_respond(tp, ti, (tcp_seq)0, ti->ti_ack, TH_RST);
+ tcp_respond(tp, ti, m, (tcp_seq)0, ti->ti_ack, TH_RST);
- tcp_respond(tp, ti, ti->ti_seq+ti->ti_len, (tcp_seq)0,
+ tcp_respond(tp, ti, m, ti->ti_seq+ti->ti_len, (tcp_seq)0,