Changeset 2989c7e in mainline for uspace/srv/net/tcp/service.c


Ignore:
Timestamp:
2015-05-25T21:04:33Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ab6326bc
Parents:
58e9dec
Message:

Association map / portrange prototype.

File:
1 edited

Legend:

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

    r58e9dec r2989c7e  
    335335        tcp_conn_t *conn;
    336336        tcp_cconn_t *cconn;
    337         inet_ep2_t cepp;
    338337        int rc;
    339338        tcp_error_t trc;
     
    343342        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_impl");
    344343
    345         cepp = *epp;
    346 
    347         /* Fill in local address? */
    348         if (inet_addr_is_any(&epp->local.addr)) {
    349                 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_impl: "
    350                     "determine local address");
    351                 rc = inet_get_srcaddr(&epp->remote.addr, 0, &cepp.local.addr);
    352                 if (rc != EOK) {
    353                         log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_impl: "
    354                             "cannot determine local address");
    355                         return rc;
    356                 }
    357         } else {
    358                 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_impl: "
    359                     "local address specified");
    360         }
    361 
    362         /* Allocate local port? */
    363         if (cepp.local.port == 0) {
    364                 cepp.local.port = 49152; /* XXX */
    365                 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_impl: "
    366                     "allocated local port %" PRIu16, cepp.local.port);
    367         } else {
    368                 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_impl: "
    369                     "local port %" PRIu16 " specified", cepp.local.port);
    370         }
    371 
    372         inet_addr_format(&cepp.local.addr, &slocal);
    373         inet_addr_format(&cepp.remote.addr, &sremote);
     344        inet_addr_format(&epp->local.addr, &slocal);
     345        inet_addr_format(&epp->remote.addr, &sremote);
    374346        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create: local=%s remote=%s",
    375347            slocal, sremote);
     
    377349        free(sremote);
    378350
    379         trc = tcp_uc_open(&cepp, ap_active, tcp_open_nonblock, &conn);
     351        trc = tcp_uc_open(epp, ap_active, tcp_open_nonblock, &conn);
    380352        if (trc != TCP_EOK)
    381353                return EIO;
Note: See TracChangeset for help on using the changeset viewer.