Changeset 291c792 in mainline
- Timestamp:
- 2012-03-08T21:54:25Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fa101c4
- Parents:
- 0e94b979
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/inetcfg.c
r0e94b979 r291c792 138 138 async_exch_t *exch = async_exchange_begin(inetcfg_sess); 139 139 140 int rc = async_req_3_1(exch, INETCFG_ADDR_CREATE_STATIC, naddr->ipv4, 141 naddr->bits, link_id, addr_id); 142 async_exchange_end(exch); 143 144 return rc; 140 ipc_call_t answer; 141 aid_t req = async_send_3(exch, INETCFG_ADDR_CREATE_STATIC, naddr->ipv4, 142 naddr->bits, link_id, &answer); 143 sysarg_t retval = async_data_write_start(exch, name, str_size(name)); 144 145 async_exchange_end(exch); 146 147 if (retval != EOK) { 148 async_wait_for(req, NULL); 149 return retval; 150 } 151 152 async_wait_for(req, &retval); 153 *addr_id = IPC_GET_ARG1(answer); 154 155 return retval; 145 156 } 146 157 -
uspace/srv/inet/inetcfg.c
r0e94b979 r291c792 50 50 #include "inetcfg.h" 51 51 52 static int inetcfg_addr_create_static( inet_naddr_t *naddr, sysarg_t link_id,53 sysarg_t *addr_id)52 static int inetcfg_addr_create_static(char *name, inet_naddr_t *naddr, 53 sysarg_t link_id, sysarg_t *addr_id) 54 54 { 55 55 inet_link_t *ilink; … … 68 68 addr->naddr = *naddr; 69 69 addr->ilink = ilink; 70 addr->name = str_dup( "foo");70 addr->name = str_dup(name); 71 71 inet_addrobj_add(addr); 72 72 … … 129 129 ipc_call_t *call) 130 130 { 131 char *name; 131 132 inet_naddr_t naddr; 132 133 sysarg_t link_id; … … 136 137 log_msg(LVL_DEBUG, "inetcfg_addr_create_static_srv()"); 137 138 139 rc = async_data_write_accept((void **) &name, true, 0, LOC_NAME_MAXLEN, 140 0, NULL); 141 if (rc != EOK) { 142 async_answer_0(callid, rc); 143 return; 144 } 145 138 146 naddr.ipv4 = IPC_GET_ARG1(*call); 139 147 naddr.bits = IPC_GET_ARG2(*call); … … 141 149 142 150 addr_id = 0; 143 rc = inetcfg_addr_create_static(&naddr, link_id, &addr_id); 151 rc = inetcfg_addr_create_static(name, &naddr, link_id, &addr_id); 152 free(name); 144 153 async_answer_1(callid, rc, addr_id); 145 154 }
Note:
See TracChangeset
for help on using the changeset viewer.