case AF_INET:
return inet_ntoa(*((struct in_addr *)addr));
- break;
case AF_INET6:
return inet6_ntoa(*((struct in6_addr *)addr));
- break;
default:
return "<Addr in unknown AF>";
- break;
}
}
case AF_INET:
return 4;
- break;
case AF_INET6:
return 16;
- break;
default:
assert(0);
return 16;
if (nexthop->type == NEXTHOP_TYPE_IPV4
|| nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) {
nhi.gateway = &nexthop->gate;
- if (nexthop->src.ipv4.s_addr)
+ if (nexthop->src.ipv4.s_addr != INADDR_ANY)
src = &nexthop->src;
}
}
if (nexthop->type == NEXTHOP_TYPE_IFINDEX) {
- if (nexthop->src.ipv4.s_addr)
+ if (nexthop->src.ipv4.s_addr != INADDR_ANY)
src = &nexthop->src;
}
ri->rtm_type = RTN_UNICAST;
ri->metric = &re->metric;
- for (ALL_NEXTHOPS_PTR(re->nhe->nhg, nexthop)) {
+ for (ALL_NEXTHOPS(re->nhe->nhg, nexthop)) {
if (ri->num_nhs >= zrouter.multipath_num)
break;
if (!netlink_route_info_fill(ri, cmd, dest, re))
return 0;
- zfpm_log_route_info(ri, __FUNCTION__);
+ zfpm_log_route_info(ri, __func__);
return netlink_route_info_encode(ri, in_buf, in_buf_len);
}