Changes in uspace/lib/inet/src/iplink_srv.c [ec7902d:cdd6fc9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/inet/src/iplink_srv.c
rec7902d rcdd6fc9 1 1 /* 2 * Copyright (c) 20 12Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup lib c29 /** @addtogroup libinet 30 30 * @{ 31 31 */ … … 36 36 37 37 #include <errno.h> 38 #include <inet/eth_addr.h> 38 39 #include <ipc/iplink.h> 39 40 #include <stdlib.h> … … 51 52 static void iplink_get_mac48_srv(iplink_srv_t *srv, ipc_call_t *icall) 52 53 { 53 addr48_t mac;54 eth_addr_t mac; 54 55 errno_t rc = srv->ops->get_mac48(srv, &mac); 55 56 if (rc != EOK) { … … 66 67 } 67 68 68 if (size != sizeof( addr48_t)) {69 if (size != sizeof(eth_addr_t)) { 69 70 async_answer_0(&call, EINVAL); 70 71 async_answer_0(icall, EINVAL); … … 73 74 74 75 rc = async_data_read_finalize(&call, &mac, size); 75 if (rc != EOK) 76 async_answer_0(&call, rc); 76 if (rc != EOK) { 77 async_answer_0(&call, rc); 78 async_answer_0(icall, rc); 79 return; 80 } 77 81 78 82 async_answer_0(icall, rc); … … 83 87 errno_t rc; 84 88 size_t size; 85 addr48_t mac;89 eth_addr_t mac; 86 90 87 91 ipc_call_t call; … … 93 97 rc = srv->ops->set_mac48(srv, &mac); 94 98 if (rc != EOK) { 95 async_answer_0(icall, rc); 96 return; 97 } 98 99 rc = async_data_read_finalize(&call, &mac, sizeof(addr48_t)); 100 if (rc != EOK) 101 async_answer_0(&call, rc); 99 async_answer_0(&call, rc); 100 async_answer_0(icall, rc); 101 return; 102 } 103 104 rc = async_data_read_finalize(&call, &mac, sizeof(eth_addr_t)); 105 if (rc != EOK) { 106 async_answer_0(&call, rc); 107 async_answer_0(icall, rc); 108 return; 109 } 102 110 103 111 async_answer_0(icall, rc); … … 108 116 ipc_call_t call; 109 117 size_t size; 118 110 119 if (!async_data_write_receive(&call, &size)) { 111 120 async_answer_0(&call, EREFUSED); … … 125 134 async_answer_0(&call, rc); 126 135 async_answer_0(icall, rc); 136 return; 127 137 } 128 138 … … 135 145 ipc_call_t call; 136 146 size_t size; 147 137 148 if (!async_data_write_receive(&call, &size)) { 138 149 async_answer_0(&call, EREFUSED); … … 152 163 async_answer_0(&call, rc); 153 164 async_answer_0(icall, rc); 165 return; 154 166 } 155 167 … … 180 192 { 181 193 iplink_sdu6_t sdu; 182 183 ipc_call_t call;184 size_t size; 194 ipc_call_t call; 195 size_t size; 196 185 197 if (!async_data_write_receive(&call, &size)) { 186 198 async_answer_0(&call, EREFUSED); … … 189 201 } 190 202 191 if (size != sizeof( addr48_t)) {203 if (size != sizeof(eth_addr_t)) { 192 204 async_answer_0(&call, EINVAL); 193 205 async_answer_0(icall, EINVAL); … … 322 334 } 323 335 324 errno_t iplink_ev_change_addr(iplink_srv_t *srv, addr48_t *addr)336 errno_t iplink_ev_change_addr(iplink_srv_t *srv, eth_addr_t *addr) 325 337 { 326 338 if (srv->client_sess == NULL) … … 332 344 aid_t req = async_send_0(exch, IPLINK_EV_CHANGE_ADDR, &answer); 333 345 334 errno_t rc = async_data_write_start(exch, addr, sizeof( addr48_t));346 errno_t rc = async_data_write_start(exch, addr, sizeof(eth_addr_t)); 335 347 async_exchange_end(exch); 336 348
Note:
See TracChangeset
for help on using the changeset viewer.