Changes in uspace/srv/net/udp/sock.c [695b6ff:f4a27304] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/udp/sock.c
r695b6ff rf4a27304 1 1 /* 2 2 * Copyright (c) 2008 Lukas Mejdrech 3 * Copyright (c) 201 3Jiri Svoboda3 * Copyright (c) 2012 Jiri Svoboda 4 4 * All rights reserved. 5 5 * … … 349 349 fibril_mutex_lock(&socket->lock); 350 350 351 if (inet_addr_is_any(&socket->assoc->ident.local.addr) && 352 socket->assoc->ident.iplink == 0) { 351 if (inet_addr_is_any(&socket->assoc->ident.local.addr)) { 353 352 /* Determine local IP address */ 354 353 inet_addr_t loc_addr; … … 666 665 static void udp_sock_setsockopt(udp_client_t *client, ipc_callid_t callid, ipc_call_t call) 667 666 { 668 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_setsockopt)"); 669 log_msg(LOG_DEFAULT, LVL_DEBUG, " - async_data_write_accept"); 670 671 void *data = NULL; 672 size_t data_len; 673 int rc = async_data_write_accept(&data, false, 0, 0, 0, &data_len); 674 if (rc != EOK) { 675 log_msg(LOG_DEFAULT, LVL_DEBUG, " - failed accepting data"); 676 async_answer_0(callid, rc); 677 return; 678 } 679 680 sysarg_t opt_level = SOL_SOCKET; 681 sysarg_t opt_name = SOCKET_GET_OPT_NAME(call); 682 683 if (opt_level != SOL_SOCKET || opt_name != SO_IPLINK || 684 data_len != sizeof(service_id_t)) { 685 log_msg(LOG_DEFAULT, LVL_DEBUG, " - failed opt_level/name/len"); 686 log_msg(LOG_DEFAULT, LVL_DEBUG, " - failed opt_level=%d, " 687 "opt_name=%d, data_len=%zu", (int)opt_level, (int)opt_name, 688 data_len); 689 async_answer_0(callid, EINVAL); 690 return; 691 } 692 693 log_msg(LOG_DEFAULT, LVL_DEBUG, " - call socket_cores_find"); 694 695 socket_core_t *sock_core = socket_cores_find(&client->sockets, 696 SOCKET_GET_SOCKET_ID(call)); 697 if (sock_core == NULL) { 698 log_msg(LOG_DEFAULT, LVL_DEBUG, " - failed getting sock_core"); 699 async_answer_0(callid, ENOENT); 700 return; 701 } 702 703 udp_sockdata_t *socket = 704 (udp_sockdata_t *) sock_core->specific_data; 705 706 service_id_t iplink = *(service_id_t *)data; 707 udp_uc_set_iplink(socket->assoc, iplink); 708 709 log_msg(LOG_DEFAULT, LVL_DEBUG, " - success"); 710 async_answer_0(callid, EOK); 711 } 712 667 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_setsockopt()"); 668 async_answer_0(callid, ENOTSUP); 669 } 713 670 714 671 static int udp_sock_recv_fibril(void *arg) … … 757 714 758 715 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recv_fibril() exited loop"); 716 fibril_mutex_unlock(&sock->recv_buffer_lock); 759 717 udp_uc_destroy(sock->assoc); 760 718 … … 772 730 /* Accept the connection */ 773 731 async_answer_0(iid, EOK); 774 775 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_connection: begin");776 732 777 733 client.sess = async_callback_receive(EXCHANGE_SERIALIZE);
Note:
See TracChangeset
for help on using the changeset viewer.