lwkt_gettoken(&head->so_rcv.ssb_token);
TAILQ_REMOVE(&head->so_incomp, so, so_list);
head->so_incqlen--;
- soclrstate(so, SS_INCOMP);
TAILQ_INSERT_TAIL(&head->so_comp, so, so_list);
head->so_qlen++;
sosetstate(so, SS_COMP);
+ soclrstate(so, SS_INCOMP);
lwkt_reltoken(&head->so_rcv.ssb_token);
sorwakeup(head);
* NOTE: Clearing NOFDREF implies referencing the so with
* soreference().
*/
- so->so_state = head->so_state | SS_NOFDREF;
+ so->so_state = head->so_state | SS_NOFDREF | SS_ASSERTINPROG;
so->so_proto = head->so_proto;
so->so_cred = crhold(head->so_cred);
ai.sb_rlimit = NULL;
head->so_rcv.ssb_hiwat, NULL) ||
(*so->so_proto->pr_usrreqs->pru_attach)(so, 0, &ai)) {
so->so_head = NULL;
+ soclrstate(so, SS_ASSERTINPROG);
sofree(so); /* remove implied pcb ref */
return (NULL);
}
wakeup((caddr_t)&head->so_timeo);
sosetstate(so, connstatus);
}
+ soclrstate(so, SS_ASSERTINPROG);
return (so);
}
* NB: we assume m is a single mbuf.
*/
if (data_len > M_TRAILINGSPACE(m)) {
+ /* XXX use m_getb(data_len, MB_DONTWAIT, MT_DATA, 0); */
struct mbuf *n = m_get(MB_DONTWAIT, MT_DATA);
if (n == NULL) {
m_freem(m);
return;
}
+ KKASSERT(data_len <= M_TRAILINGSPACE(n));
bcopy(data, mtod(n, void *), data_len);
n->m_len = data_len;
m->m_next = n;
#define SS_CANTRCVMORE 0x0020 /* can't receive more data from peer */
#define SS_RCVATMARK 0x0040 /* at mark on input */
-#define SS_UNUSED0100 0x0100
+#define SS_ASSERTINPROG 0x0100 /* sonewconn race debugging */
#define SS_ASYNC 0x0200 /* async i/o notify */
#define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */