Changeset 03c971f in mainline for uspace/srv/net/udp/assoc.c
- Timestamp:
- 2013-08-15T14:20:16Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb2a5b2
- Parents:
- f2c19b0 (diff), 2921602 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/udp/assoc.c
rf2c19b0 r03c971f 82 82 if (lsock != NULL) 83 83 assoc->ident.local = *lsock; 84 84 85 if (fsock != NULL) 85 86 assoc->ident.foreign = *fsock; … … 251 252 sp.foreign = *fsock; 252 253 253 if (sp.foreign.addr.ipv4 == 0 || sp.foreign.port == 0) 254 if ((inet_addr_is_any(&sp.foreign.addr)) || 255 (sp.foreign.port == UDP_PORT_ANY)) 254 256 return EINVAL; 255 257 … … 370 372 static bool udp_socket_match(udp_sock_t *sock, udp_sock_t *patt) 371 373 { 372 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_socket_match(sock=(%x,%u), pat=(%x,%u))",373 sock->addr.ipv4, sock->port, patt->addr.ipv4, patt->port);374 375 if ( patt->addr.ipv4 != UDP_IPV4_ANY&&376 patt->addr.ipv4 != sock->addr.ipv4)374 log_msg(LOG_DEFAULT, LVL_DEBUG, 375 "udp_socket_match(sock=(%u), pat=(%u))", sock->port, patt->port); 376 377 if ((!inet_addr_is_any(&patt->addr)) && 378 (!inet_addr_compare(&patt->addr, &sock->addr))) 377 379 return false; 378 379 if ( patt->port != UDP_PORT_ANY&&380 patt->port != sock->port)380 381 if ((patt->port != UDP_PORT_ANY) && 382 (patt->port != sock->port)) 381 383 return false; 382 384 383 385 log_msg(LOG_DEFAULT, LVL_DEBUG, " -> match"); 384 386 385 387 return true; 386 388 } … … 414 416 { 415 417 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_find_ref(%p)", sp); 416 418 417 419 fibril_mutex_lock(&assoc_list_lock); 418 420 419 421 list_foreach(assoc_list, link) { 420 422 udp_assoc_t *assoc = list_get_instance(link, udp_assoc_t, link); 421 423 udp_sockpair_t *asp = &assoc->ident; 422 log_msg(LOG_DEFAULT, LVL_DEBUG, "compare with assoc (f:(%x,%u), l:(%x,%u))", 423 asp->foreign.addr.ipv4, asp->foreign.port, 424 asp->local.addr.ipv4, asp->local.port); 425 424 426 425 /* Skip unbound associations */ 427 426 if (asp->local.port == UDP_PORT_ANY) 428 427 continue; 429 428 430 429 if (udp_sockpair_match(sp, asp)) { 431 430 log_msg(LOG_DEFAULT, LVL_DEBUG, "Returning assoc %p", assoc); … … 435 434 } 436 435 } 437 436 438 437 fibril_mutex_unlock(&assoc_list_lock); 439 438 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.