Changeset 3e2291a9 in mainline for uspace/srv/net/tcp/conn.c


Ignore:
Timestamp:
2017-09-17T23:37:43Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
797dc79e
Parents:
6969eea3
Message:

TCP tests for ucall module and some more for conn module. Implement tcp_uc_abort(). Fix tcp_uc_open() leaking connection of connecting failed. Fix missing transition Closing → Time-Wait. Fix wrong SEG.ACK in response to FIN.

File:
1 edited

Legend:

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

    r6969eea3 r3e2291a9  
    100100void tcp_conns_fini(void)
    101101{
     102        assert(list_empty(&conn_list));
     103
    102104        amap_destroy(amap);
    103105        amap = NULL;
    104 
    105         assert(list_empty(&conn_list));
    106106}
    107107
     
    458458
    459459        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_conn_reset()", conn->name);
     460
     461        if (conn->cstate == st_closed)
     462                return;
     463
    460464        conn->reset = true;
    461465        tcp_conn_state_set(conn, st_closed);
     
    910914                return cp_done;
    911915
    912         /* TODO */
     916        if (conn->fin_is_acked) {
     917                log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: FIN acked -> Time-Wait",
     918                    conn->name);
     919                tcp_conn_state_set(conn, st_time_wait);
     920        }
     921
    913922        return cp_continue;
    914923}
     
    11071116                log_msg(LOG_DEFAULT, LVL_DEBUG, " - FIN found in segment.");
    11081117
     1118                conn->rcv_nxt++;
     1119                conn->rcv_wnd--;
     1120
    11091121                /* Send ACK */
    11101122                tcp_tqueue_ctrl_seg(conn, CTL_ACK);
    1111 
    1112                 conn->rcv_nxt++;
    1113                 conn->rcv_wnd--;
    11141123
    11151124                /* Change connection state */
Note: See TracChangeset for help on using the changeset viewer.