Changeset 98abd40 in mainline for uspace/srv/net/udp/assoc.c
- Timestamp:
- 2013-07-06T21:57:22Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c8bb1633, cdc8a391
- Parents:
- b8e72fd1 (diff), 507c6f3 (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
rb8e72fd1 r98abd40 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 if ((!inet_addr_is_any(&patt->addr)) && 375 (!inet_addr_compare(&patt->addr, &sock->addr))) 377 376 return false; 378 379 if ( patt->port != UDP_PORT_ANY&&380 patt->port != sock->port)377 378 if ((patt->port != UDP_PORT_ANY) && 379 (patt->port != sock->port)) 381 380 return false; 382 381 383 382 log_msg(LOG_DEFAULT, LVL_DEBUG, " -> match"); 384 383 385 384 return true; 386 385 } … … 414 413 { 415 414 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_find_ref(%p)", sp); 416 415 417 416 fibril_mutex_lock(&assoc_list_lock); 418 417 419 418 list_foreach(assoc_list, link) { 420 419 udp_assoc_t *assoc = list_get_instance(link, udp_assoc_t, link); 421 420 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 421 426 422 /* Skip unbound associations */ 427 423 if (asp->local.port == UDP_PORT_ANY) 428 424 continue; 429 425 430 426 if (udp_sockpair_match(sp, asp)) { 431 427 log_msg(LOG_DEFAULT, LVL_DEBUG, "Returning assoc %p", assoc); … … 435 431 } 436 432 } 437 433 438 434 fibril_mutex_unlock(&assoc_list_lock); 439 435 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.