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