Changeset 2989c7e in mainline for uspace/srv/net/tcp/service.c
- Timestamp:
- 2015-05-25T21:04:33Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab6326bc
- Parents:
- 58e9dec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/service.c
r58e9dec r2989c7e 335 335 tcp_conn_t *conn; 336 336 tcp_cconn_t *cconn; 337 inet_ep2_t cepp;338 337 int rc; 339 338 tcp_error_t trc; … … 343 342 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create_impl"); 344 343 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); 374 346 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_create: local=%s remote=%s", 375 347 slocal, sremote); … … 377 349 free(sremote); 378 350 379 trc = tcp_uc_open( &cepp, ap_active, tcp_open_nonblock, &conn);351 trc = tcp_uc_open(epp, ap_active, tcp_open_nonblock, &conn); 380 352 if (trc != TCP_EOK) 381 353 return EIO;
Note:
See TracChangeset
for help on using the changeset viewer.