Changes in uspace/srv/net/ethip/ethip_nic.c [83781a22:5a324d99] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/ethip/ethip_nic.c
r83781a22 r5a324d99 45 45 #include <device/nic.h> 46 46 #include <stdlib.h> 47 #include <net/socket_codes.h>48 47 #include <mem.h> 49 48 #include "ethip.h" … … 84 83 already_known = false; 85 84 86 list_foreach(ethip_nic_list, link) { 87 ethip_nic_t *nic = list_get_instance(link, 88 ethip_nic_t, link); 85 list_foreach(ethip_nic_list, link, ethip_nic_t, nic) { 89 86 if (nic->svc_id == svcs[i]) { 90 87 already_known = true; … … 201 198 log_msg(LOG_DEFAULT, LVL_ERROR, "Error activating NIC '%s'.", 202 199 nic->svc_name); 200 goto error; 201 } 202 203 rc = nic_broadcast_set_mode(nic->sess, NIC_BROADCAST_ACCEPTED); 204 if (rc != EOK) { 205 log_msg(LOG_DEFAULT, LVL_ERROR, "Error enabling " 206 "reception of broadcast frames on '%s'.", nic->svc_name); 203 207 goto error; 204 208 } … … 313 317 (unsigned) iplink_sid); 314 318 315 list_foreach(ethip_nic_list, link ) {319 list_foreach(ethip_nic_list, link, ethip_nic_t, nic) { 316 320 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_find_by_iplink_sid - element"); 317 ethip_nic_t *nic = list_get_instance(link, ethip_nic_t, link);318 319 321 if (nic->iplink_sid == iplink_sid) { 320 322 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_find_by_iplink_sid - found %p", nic); … … 350 352 size_t count = 0; 351 353 352 list_foreach(nic->addr_list, link) { 353 ethip_link_addr_t *laddr = list_get_instance(link, 354 ethip_link_addr_t, link); 355 356 uint16_t af = inet_addr_get(&laddr->addr, NULL, NULL); 357 if (af == AF_INET6) 354 list_foreach(nic->addr_list, link, ethip_link_addr_t, laddr) { 355 ip_ver_t ver = inet_addr_get(&laddr->addr, NULL, NULL); 356 if (ver == ip_v6) 358 357 count++; 359 358 } … … 371 370 size_t i = 0; 372 371 373 list_foreach(nic->addr_list, link) { 372 list_foreach(nic->addr_list, link, ethip_link_addr_t, laddr) { 373 addr128_t v6; 374 ip_ver_t ver = inet_addr_get(&laddr->addr, NULL, &v6); 375 if (ver != ip_v6) 376 continue; 377 374 378 assert(i < count); 375 376 ethip_link_addr_t *laddr = list_get_instance(link,377 ethip_link_addr_t, link);378 379 addr128_t v6;380 uint16_t af = inet_addr_get(&laddr->addr, NULL, &v6);381 if (af != AF_INET6)382 continue;383 379 384 380 addr48_t mac; … … 444 440 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_find()"); 445 441 446 list_foreach(nic->addr_list, link) { 447 ethip_link_addr_t *laddr = list_get_instance(link, 448 ethip_link_addr_t, link); 449 442 list_foreach(nic->addr_list, link, ethip_link_addr_t, laddr) { 450 443 if (inet_addr_compare(addr, &laddr->addr)) 451 444 return laddr;
Note:
See TracChangeset
for help on using the changeset viewer.