Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 1,470 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
int thflags, acked, ourfinisacked, needoutput = 0, sack_changed; | int thflags, acked, ourfinisacked, needoutput = 0, sack_changed; | ||||
int rstreason, todrop, win; | int rstreason, todrop, win; | ||||
uint32_t tiwin; | uint32_t tiwin; | ||||
uint16_t nsegs; | uint16_t nsegs; | ||||
char *s; | char *s; | ||||
struct in_conninfo *inc; | struct in_conninfo *inc; | ||||
struct mbuf *mfree; | struct mbuf *mfree; | ||||
struct tcpopt to; | struct tcpopt to; | ||||
rrs: How is it safe to reference the tp like this without a lock?
I think if you are wrong it just… | |||||
int tfo_syn; | int tfo_syn; | ||||
#ifdef TCPDEBUG | #ifdef TCPDEBUG | ||||
/* | /* | ||||
* The size of tcp_saveipgen must be the size of the max ip header, | * The size of tcp_saveipgen must be the size of the max ip header, | ||||
* now IPv6. | * now IPv6. | ||||
*/ | */ | ||||
u_char tcp_saveipgen[IP6_HDR_LEN]; | u_char tcp_saveipgen[IP6_HDR_LEN]; | ||||
▲ Show 20 Lines • Show All 1,514 Lines • ▼ Show 20 Lines | if ((tlen || (thflags & TH_FIN) || tfo_syn) && | ||||
} else { | } else { | ||||
/* | /* | ||||
* XXX: Due to the header drop above "th" is | * XXX: Due to the header drop above "th" is | ||||
* theoretically invalid by now. Fortunately | * theoretically invalid by now. Fortunately | ||||
* m_adj() doesn't actually frees any mbufs | * m_adj() doesn't actually frees any mbufs | ||||
* when trimming from the head. | * when trimming from the head. | ||||
*/ | */ | ||||
tcp_seq temp = save_start; | tcp_seq temp = save_start; | ||||
tp->t_flags |= TF_DELACK; | |||||
thflags = tcp_reass(tp, th, &temp, &tlen, m); | thflags = tcp_reass(tp, th, &temp, &tlen, m); | ||||
tp->t_flags &= ~TF_DELACK; | |||||
tp->t_flags |= TF_ACKNOW; | tp->t_flags |= TF_ACKNOW; | ||||
} | } | ||||
if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { | if ((tp->t_flags & TF_SACK_PERMIT) && (save_tlen > 0)) { | ||||
if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { | if ((tlen == 0) && (SEQ_LT(save_start, save_rnxt))) { | ||||
/* | /* | ||||
* DSACK actually handled in the fastpath | * DSACK actually handled in the fastpath | ||||
* above. | * above. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 823 Lines • Show Last 20 Lines |
How is it safe to reference the tp like this without a lock?
I think if you are wrong it just means you will do a wakeup (possibly) when
you should not.. so I guess thats ok.. note the same comment applies to
the so_state check since you don't hold a socket lock either.