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