Changes in uspace/srv/net/inetsrv/inetcfg.c [02a09ed:b8b1adb1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/inetsrv/inetcfg.c
r02a09ed rb8b1adb1 44 44 #include <str.h> 45 45 #include <sys/types.h> 46 #include <types/inetcfg.h> 46 47 47 48 #include "addrobj.h" … … 151 152 static int inetcfg_get_link_list(sysarg_t **addrs, size_t *count) 152 153 { 153 return ENOTSUP;154 return inet_link_get_id_list(addrs, count); 154 155 } 155 156 … … 170 171 linfo->name = str_dup(ilink->svc_name); 171 172 linfo->def_mtu = ilink->def_mtu; 173 if (ilink->mac_valid) { 174 addr48(ilink->mac, linfo->mac_addr); 175 } else { 176 memset(linfo->mac_addr, 0, sizeof(linfo->mac_addr)); 177 } 178 172 179 return EOK; 173 180 } … … 411 418 { 412 419 ipc_callid_t rcallid; 420 size_t count; 413 421 size_t max_size; 414 422 size_t act_size; … … 417 425 int rc; 418 426 419 log_msg(LOG_DEFAULT, LVL_DEBUG, "inetcfg_get_ link_list_srv()");427 log_msg(LOG_DEFAULT, LVL_DEBUG, "inetcfg_get_addr_list_srv()"); 420 428 421 429 if (!async_data_read_receive(&rcallid, &max_size)) { … … 425 433 } 426 434 427 rc = inetcfg_get_link_list(&id_buf, & act_size);435 rc = inetcfg_get_link_list(&id_buf, &count); 428 436 if (rc != EOK) { 429 437 async_answer_0(rcallid, rc); … … 432 440 } 433 441 442 act_size = count * sizeof(sysarg_t); 434 443 size = min(act_size, max_size); 435 444 … … 476 485 static void inetcfg_link_get_srv(ipc_callid_t callid, ipc_call_t *call) 477 486 { 478 ipc_callid_t rcallid; 479 size_t max_size; 487 ipc_callid_t name_callid; 488 ipc_callid_t laddr_callid; 489 size_t name_max_size; 490 size_t laddr_max_size; 480 491 481 492 sysarg_t link_id; … … 488 499 linfo.name = NULL; 489 500 490 if (!async_data_read_receive(&rcallid, &max_size)) { 491 async_answer_0(rcallid, EREFUSED); 501 if (!async_data_read_receive(&name_callid, &name_max_size)) { 502 async_answer_0(name_callid, EREFUSED); 503 async_answer_0(callid, EREFUSED); 504 return; 505 } 506 507 if (!async_data_read_receive(&laddr_callid, &laddr_max_size)) { 508 async_answer_0(name_callid, EREFUSED); 492 509 async_answer_0(callid, EREFUSED); 493 510 return; … … 496 513 rc = inetcfg_link_get(link_id, &linfo); 497 514 if (rc != EOK) { 498 async_answer_0(rcallid, rc); 499 async_answer_0(callid, rc); 500 return; 501 } 502 503 sysarg_t retval = async_data_read_finalize(rcallid, linfo.name, 504 min(max_size, str_size(linfo.name))); 515 async_answer_0(laddr_callid, rc); 516 async_answer_0(name_callid, rc); 517 async_answer_0(callid, rc); 518 return; 519 } 520 521 sysarg_t retval = async_data_read_finalize(name_callid, linfo.name, 522 min(name_max_size, str_size(linfo.name))); 523 if (retval != EOK) { 524 free(linfo.name); 525 async_answer_0(laddr_callid, retval); 526 async_answer_0(callid, retval); 527 return; 528 } 529 530 retval = async_data_read_finalize(laddr_callid, &linfo.mac_addr, 531 min(laddr_max_size, sizeof(linfo.mac_addr))); 532 505 533 free(linfo.name); 506 534
Note:
See TracChangeset
for help on using the changeset viewer.