Changeset 5441670 in mainline for uspace/srv/net/tcp/ucall.c


Ignore:
Timestamp:
2014-09-12T13:53:24Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
662ebc8
Parents:
105d8d6
Message:

fix TCP locking issue and crash
connection needs to be locked before tcp_conn_sync() is called

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/ucall.c

    r105d8d6 r5441670  
    7676        nconn = tcp_conn_new(lsock, fsock);
    7777        tcp_conn_add(nconn);
     78        tcp_conn_lock(nconn);
    7879
    7980        if (acpass == ap_active) {
     
    8384
    8485        if (oflags == tcp_open_nonblock) {
     86                tcp_conn_unlock(nconn);
    8587                log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open -> %p", nconn);
    8688                *conn = nconn;
     
    9092        /* Wait for connection to be established or reset */
    9193        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Wait for connection.");
    92         tcp_conn_lock(nconn);
    9394        while (nconn->cstate == st_listen ||
    9495            nconn->cstate == st_syn_sent ||
Note: See TracChangeset for help on using the changeset viewer.