uint32_t seq;
uint32_t ack;
uint32_t win;
+ uint32_t ts_recent;
unsigned int flags;
size_t len;
int rc;
flags = tcphdr->flags;
tcp_rx_opts ( tcp, ( ( ( void * ) tcphdr ) + sizeof ( *tcphdr ) ),
( hlen - sizeof ( *tcphdr ) ), &options );
+ ts_recent = ( options.tsopt ?
+ ntohl ( options.tsopt->tsval ) : tcp->ts_recent );
iob_pull ( iobuf, hlen );
len = iob_len ( iobuf );
}
/* Handle new data, if any */
- tcp_rx_data ( tcp, seq, iobuf );
+ tcp_rx_data ( tcp, seq, iob_disown ( iobuf ) );
seq += len;
/* Handle FIN, if present */
seq++;
}
- /* Update timestamp, if present and applicable */
- if ( ( seq == tcp->rcv_ack ) && options.tsopt )
- tcp->ts_recent = ntohl ( options.tsopt->tsval );
+ /* Update timestamp, if applicable */
+ if ( seq == tcp->rcv_ack )
+ tcp->ts_recent = ts_recent;
/* Dump out any state change as a result of the received packet */
tcp_dump_state ( tcp );