Changes in uspace/srv/net/ethip/ethip_nic.c [a2e3ee6:3e6a98c5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/ethip/ethip_nic.c
ra2e3ee6 r3e6a98c5 121 121 } 122 122 123 static ethip_link_addr_t *ethip_nic_addr_new( uint32_taddr)123 static ethip_link_addr_t *ethip_nic_addr_new(iplink_srv_addr_t *addr) 124 124 { 125 125 ethip_link_addr_t *laddr = calloc(1, sizeof(ethip_link_addr_t)); 126 126 127 if (laddr == NULL) { 127 128 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed allocating NIC address structure. " … … 129 130 return NULL; 130 131 } 131 132 132 133 link_initialize(&laddr->addr_list); 133 laddr->addr = addr; 134 134 laddr->addr.ipv4 = addr->ipv4; 135 135 return laddr; 136 136 } … … 335 335 } 336 336 337 int ethip_nic_addr_add(ethip_nic_t *nic, uint32_t addr) 338 { 337 int ethip_nic_addr_add(ethip_nic_t *nic, iplink_srv_addr_t *addr) 338 { 339 ethip_link_addr_t *laddr; 340 339 341 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_add()"); 340 341 ethip_link_addr_t *laddr = ethip_nic_addr_new(addr); 342 laddr = ethip_nic_addr_new(addr); 342 343 if (laddr == NULL) 343 344 return ENOMEM; 344 345 345 346 list_append(&laddr->addr_list, &nic->addr_list); 346 347 return EOK; 347 348 } 348 349 349 int ethip_nic_addr_remove(ethip_nic_t *nic, uint32_t addr) 350 { 350 int ethip_nic_addr_remove(ethip_nic_t *nic, iplink_srv_addr_t *addr) 351 { 352 ethip_link_addr_t *laddr; 353 351 354 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_remove()"); 352 353 ethip_link_addr_t *laddr = ethip_nic_addr_find(nic, addr);355 356 laddr = ethip_nic_addr_find(nic, addr); 354 357 if (laddr == NULL) 355 358 return ENOENT; 356 359 357 360 list_remove(&laddr->addr_list); 358 361 ethip_link_addr_delete(laddr); … … 361 364 362 365 ethip_link_addr_t *ethip_nic_addr_find(ethip_nic_t *nic, 363 uint32_taddr)366 iplink_srv_addr_t *addr) 364 367 { 365 368 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_find()"); … … 369 372 ethip_link_addr_t, addr_list); 370 373 371 if (addr == laddr->addr)374 if (addr->ipv4 == laddr->addr.ipv4) 372 375 return laddr; 373 376 }
Note:
See TracChangeset
for help on using the changeset viewer.