Skip to content

Commit

Permalink
[SQUASH ME] fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed May 17, 2015
1 parent 024365c commit c159fa5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,13 @@ void ng_ipv6_netif_init_by_dev(void)

ifs = ng_netif_get(&ifnum);

for (int i = 0; i < ifnum; i++) {
for (size_t i = 0; i < ifnum; i++) {
ng_ipv6_addr_t addr;
uint16_t hwaddr_len = 0;
uint8_t hwaddr[8];
bool try_long = false;
ng_ipv6_netif_t *ipv6_if = ng_ipv6_netif_get(ifs[i]);
int res = 0;

if (ipv6_if == NULL) {
continue;
Expand All @@ -487,11 +488,12 @@ void ng_ipv6_netif_init_by_dev(void)
try_long = true;
}

if ((try_long && (ng_netapi_get(ifs[i], NETCONF_OPT_ADDRESS_LONG, 0,
&hwaddr, sizeof(hwaddr)) != -ENOTSUP)) ||
(ng_netapi_get(ifs[i], NETCONF_OPT_ADDRESS, 0, &hwaddr,
sizeof(hwaddr)) != -ENOTSUP)) {
if ((try_long && ((res = ng_netapi_get(ifs[i], NETCONF_OPT_ADDRESS_LONG, 0,
&hwaddr, sizeof(hwaddr))) > 0)) ||
((res = ng_netapi_get(ifs[i], NETCONF_OPT_ADDRESS, 0, &hwaddr,
sizeof(hwaddr))) > 0)) {
uint8_t iid[IID_LEN];
hwaddr_len = (uint16_t)res;

if (_hwaddr_to_iid(iid, hwaddr, hwaddr_len)) {
ng_ipv6_addr_set_aiid(&addr, iid);
Expand Down

0 comments on commit c159fa5

Please sign in to comment.