Move last tcpcb initialization for the inbound connection case from

tcp_input() to syncache_socket() where it belongs and the majority
of it already happens.

The "tp->snd_up = tp->snd_una" is removed as it is done with the
tcp_sendseqinit() macro a few lines earlier.
This commit is contained in:
Andre Oppermann 2007-04-04 16:13:45 +00:00
parent 44c900afd7
commit 0c38fd0a7a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168368
3 changed files with 7 additions and 20 deletions

View File

@ -854,18 +854,10 @@ tcp_input(struct mbuf *m, int off0)
* Socket is created in state SYN_RECEIVED.
* Continue processing segment.
*/
INP_UNLOCK(inp);
INP_UNLOCK(inp); /* listen socket */
inp = sotoinpcb(so);
INP_LOCK(inp);
INP_LOCK(inp); /* new connection */
tp = intotcpcb(inp);
/*
* This is what would have happened in
* tcp_output() when the SYN,ACK was sent.
*/
tp->snd_up = tp->snd_una;
tp->snd_max = tp->snd_nxt = tp->iss + 1;
tp->last_ack_sent = tp->rcv_nxt;
/*
* Process the segment and the data it
* contains. tcp_do_segment() consumes

View File

@ -854,18 +854,10 @@ tcp_input(struct mbuf *m, int off0)
* Socket is created in state SYN_RECEIVED.
* Continue processing segment.
*/
INP_UNLOCK(inp);
INP_UNLOCK(inp); /* listen socket */
inp = sotoinpcb(so);
INP_LOCK(inp);
INP_LOCK(inp); /* new connection */
tp = intotcpcb(inp);
/*
* This is what would have happened in
* tcp_output() when the SYN,ACK was sent.
*/
tp->snd_up = tp->snd_una;
tp->snd_max = tp->snd_nxt = tp->iss + 1;
tp->last_ack_sent = tp->rcv_nxt;
/*
* Process the segment and the data it
* contains. tcp_do_segment() consumes

View File

@ -687,9 +687,12 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
tcp_rcvseqinit(tp);
tcp_sendseqinit(tp);
tp->snd_wl1 = sc->sc_irs;
tp->snd_max = tp->iss + 1;
tp->snd_nxt = tp->iss + 1;
tp->rcv_up = sc->sc_irs + 1;
tp->rcv_wnd = sc->sc_wnd;
tp->rcv_adv += tp->rcv_wnd;
tp->last_ack_sent = tp->rcv_nxt;
tp->t_flags = sototcpcb(lso)->t_flags & (TF_NOPUSH|TF_NODELAY);
if (sc->sc_flags & SCF_NOOPT)