Changeset 2f0dd2a in mainline


Ignore:
Timestamp:
2011-12-23T09:56:54Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
153cc76a, 7e1b130
Parents:
fe5e9629
Message:

Stricter RST processing in Syn-sent state.

File:
1 edited

Legend:

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

    rfe5e9629 r2f0dd2a  
    491491                    conn->snd_una, seg->ack, conn->snd_nxt);
    492492                if (!seq_no_ack_acceptable(conn, seg->ack)) {
    493                         log_msg(LVL_WARN, "ACK not acceptable, send RST.");
    494                         tcp_reply_rst(&conn->ident, seg);
     493                        if ((seg->ctrl & CTL_RST) == 0) {
     494                                log_msg(LVL_WARN, "ACK not acceptable, send RST");
     495                                tcp_reply_rst(&conn->ident, seg);
     496                        } else {
     497                                log_msg(LVL_WARN, "RST,ACK not acceptable, drop");
     498                        }
    495499                        return;
    496500                }
     
    498502
    499503        if ((seg->ctrl & CTL_RST) != 0) {
    500                 log_msg(LVL_DEBUG, "%s: Connection reset. -> Closed",
    501                     conn->name);
    502                 /* Reset connection */
    503                 tcp_conn_reset(conn);
    504                 /* XXX delete connection */
    505                 return;
     504                /* If we get here, we have either an acceptable ACK or no ACK */
     505                if ((seg->ctrl & CTL_ACK) != 0) {
     506                        log_msg(LVL_DEBUG, "%s: Connection reset. -> Closed",
     507                            conn->name);
     508                        /* Reset connection */
     509                        tcp_conn_reset(conn);
     510                        return;
     511                } else {
     512                        log_msg(LVL_DEBUG, "%s: RST without ACK, drop",
     513                            conn->name);
     514                        return;
     515                }
    506516        }
    507517
Note: See TracChangeset for help on using the changeset viewer.