Changes in / [d1538a1:a1e2df13] in mainline
- Files:
-
- 10 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
rd1538a1 ra1e2df13 113 113 $(USPACE_PATH)/srv/hid/remcons/remcons \ 114 114 $(USPACE_PATH)/srv/hid/isdv4_tablet/isdv4_tablet \ 115 $(USPACE_PATH)/srv/net/dnsres/dnsres \ 115 116 $(USPACE_PATH)/srv/net/ethip/ethip \ 116 117 $(USPACE_PATH)/srv/net/inetsrv/inetsrv \ -
uspace/Makefile
rd1538a1 ra1e2df13 83 83 srv/devman \ 84 84 srv/loader \ 85 srv/net/dnsres \ 85 86 srv/net/ethip \ 86 87 srv/net/inetsrv \ -
uspace/srv/net/inetsrv/addrobj.c
rd1538a1 ra1e2df13 221 221 222 222 lsrc_addr.ipv4 = addr->naddr.ipv4; 223 ldest_addr = &dgram->dest;223 ldest_addr = ldest; 224 224 225 225 return inet_link_send_dgram(addr->ilink, &lsrc_addr, ldest_addr, dgram, -
uspace/srv/net/inetsrv/inet_link.c
rd1538a1 ra1e2df13 202 202 first = 0; 203 203 } else { 204 addr->naddr.ipv4 = (1 92 << 24) + (168 << 16) + (0 << 8) + 4;204 addr->naddr.ipv4 = (10 << 24) + (0 << 16) + (0 << 8) + 2; 205 205 } 206 206 addr->naddr.bits = 24; -
uspace/srv/net/udp/assoc.c
rd1538a1 ra1e2df13 264 264 265 265 fibril_mutex_lock(&assoc->lock); 266 while (list_empty(&assoc->rcv_queue) ) {266 while (list_empty(&assoc->rcv_queue) && !assoc->reset) { 267 267 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - waiting"); 268 268 fibril_condvar_wait(&assoc->rcv_queue_cv, &assoc->lock); 269 } 270 271 if (assoc->reset) { 272 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv() - association was reset"); 273 fibril_mutex_unlock(&assoc->lock); 274 return ECONNABORTED; 269 275 } 270 276 … … 308 314 } 309 315 316 /** Reset association. 317 * 318 * This causes any pendingreceive operations to return immediately with 319 * UDP_ERESET. 320 */ 321 void udp_assoc_reset(udp_assoc_t *assoc) 322 { 323 fibril_mutex_lock(&assoc->lock); 324 assoc->reset = true; 325 fibril_condvar_broadcast(&assoc->rcv_queue_cv); 326 fibril_mutex_unlock(&assoc->lock); 327 } 328 310 329 static int udp_assoc_queue_msg(udp_assoc_t *assoc, udp_sockpair_t *sp, 311 330 udp_msg_t *msg) -
uspace/srv/net/udp/assoc.h
rd1538a1 ra1e2df13 50 50 extern int udp_assoc_recv(udp_assoc_t *, udp_msg_t **, udp_sock_t *); 51 51 extern void udp_assoc_received(udp_sockpair_t *, udp_msg_t *); 52 52 extern void udp_assoc_reset(udp_assoc_t *); 53 53 54 54 #endif -
uspace/srv/net/udp/sock.c
rd1538a1 ra1e2df13 359 359 rc = EOK; 360 360 break; 361 /* case TCP_ENOTEXIST:361 case UDP_ENORES: 362 362 rc = ENOTCONN; 363 363 break; 364 case TCP_ECLOSING:365 rc = E NOTCONN;366 break; 367 case TCP_ERESET:368 rc = E CONNABORTED;369 break; */364 case UDP_EUNSPEC: 365 rc = EINVAL; 366 break; 367 case UDP_ENOROUTE: 368 rc = EIO; 369 break; 370 370 default: 371 371 assert(false); … … 543 543 fibril_mutex_lock(&socket->lock); 544 544 545 fibril_mutex_lock(&socket->recv_buffer_lock); 546 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_close - set socket->sock_core = NULL"); 547 socket->sock_core = NULL; 548 fibril_mutex_unlock(&socket->recv_buffer_lock); 549 550 udp_uc_reset(socket->assoc); 551 545 552 rc = socket_destroy(NULL, socket_id, &client->sockets, &gsock, 546 553 udp_free_sock_data); 547 554 if (rc != EOK) { 555 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_close - socket_destroy failed"); 548 556 fibril_mutex_unlock(&socket->lock); 549 557 async_answer_0(callid, rc); 550 558 return; 551 559 } 560 561 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_close - broadcast recv_buffer_cv"); 562 fibril_condvar_broadcast(&socket->recv_buffer_cv); 552 563 553 564 fibril_mutex_unlock(&socket->lock); … … 576 587 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recv_fibril()"); 577 588 589 fibril_mutex_lock(&sock->recv_buffer_lock); 590 578 591 while (true) { 579 592 log_msg(LOG_DEFAULT, LVL_DEBUG, "[] wait for rcv buffer empty()"); 580 fibril_mutex_lock(&sock->recv_buffer_lock); 581 while (sock->recv_buffer_used != 0) { 593 while (sock->recv_buffer_used != 0 && sock->sock_core != NULL) { 582 594 fibril_condvar_wait(&sock->recv_buffer_cv, 583 595 &sock->recv_buffer_lock); … … 589 601 sock->recv_error = urc; 590 602 591 udp_sock_notify_data(sock->sock_core); 603 log_msg(LOG_DEFAULT, LVL_DEBUG, "[] udp_uc_receive -> %d", urc); 604 605 if (sock->sock_core != NULL) 606 udp_sock_notify_data(sock->sock_core); 592 607 593 608 if (urc != UDP_EOK) { 609 log_msg(LOG_DEFAULT, LVL_DEBUG, "[] urc != UDP_EOK, break"); 594 610 fibril_condvar_broadcast(&sock->recv_buffer_cv); 595 fibril_mutex_unlock(&sock->recv_buffer_lock);596 611 break; 597 612 } … … 600 615 601 616 sock->recv_buffer_used = rcvd; 602 fibril_mutex_unlock(&sock->recv_buffer_lock);603 617 fibril_condvar_broadcast(&sock->recv_buffer_cv); 604 618 } 605 619 620 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recv_fibril() exited loop"); 621 fibril_mutex_unlock(&sock->recv_buffer_lock); 606 622 udp_uc_destroy(sock->assoc); 623 624 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recv_fibril() terminated"); 607 625 608 626 return 0; -
uspace/srv/net/udp/ucall.c
rd1538a1 ra1e2df13 105 105 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: udp_uc_receive()", assoc->name); 106 106 rc = udp_assoc_recv(assoc, &msg, fsock); 107 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_assoc_recv -> %d", rc); 107 108 switch (rc) { 109 case EOK: 110 break; 111 case ECONNABORTED: 112 return UDP_ERESET; 113 default: 114 assert(false); 108 115 } 109 116 … … 125 132 { 126 133 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_uc_destroy()"); 134 udp_assoc_reset(assoc); 127 135 udp_assoc_remove(assoc); 128 136 udp_assoc_delete(assoc); 137 } 138 139 void udp_uc_reset(udp_assoc_t *assoc) 140 { 141 udp_assoc_reset(assoc); 129 142 } 130 143 -
uspace/srv/net/udp/ucall.h
rd1538a1 ra1e2df13 48 48 extern void udp_uc_status(udp_assoc_t *, udp_assoc_status_t *); 49 49 extern void udp_uc_destroy(udp_assoc_t *); 50 extern void udp_uc_reset(udp_assoc_t *); 50 51 51 52 #endif -
uspace/srv/net/udp/udp_type.h
rd1538a1 ra1e2df13 51 51 UDP_EUNSPEC, 52 52 /* No route to destination */ 53 UDP_ENOROUTE 53 UDP_ENOROUTE, 54 /** Association reset by user */ 55 UDP_ERESET 54 56 } udp_error_t; 55 57 … … 119 121 udp_sockpair_t ident; 120 122 123 /** True if association was reset by user */ 124 bool reset; 125 121 126 /** True if association was deleted by user */ 122 127 bool deleted;
Note:
See TracChangeset
for help on using the changeset viewer.