return r;
for (sd_netlink_message *m = reply; m; m = sd_netlink_message_next(m)) {
- _cleanup_ordered_set_free_free_ OrderedSet *multipath_routes = NULL;
- _cleanup_free_ void *rta_multipath = NULL;
- union in_addr_union gateway;
uint16_t type;
unsigned char dst_len, src_len, table;
uint32_t ifi = 0, priority = 0;
- size_t rta_len;
int family;
- RouteVia via;
r = sd_netlink_message_get_errno(m);
if (r < 0)
if (ifindex > 0 && (int) ifi != ifindex)
continue;
+ union in_addr_union gateway;
r = netlink_message_read_in_addr_union(m, RTA_GATEWAY, family, &gateway);
if (r < 0 && r != -ENODATA)
return r;
if (family != AF_INET)
continue;
+ RouteVia via;
r = sd_netlink_message_read(m, RTA_VIA, sizeof(via), &via);
if (r < 0 && r != -ENODATA)
return r;
}
}
+ size_t rta_len;
+ _cleanup_free_ void *rta_multipath = NULL;
r = sd_netlink_message_read_data(m, RTA_MULTIPATH, &rta_len, &rta_multipath);
if (r < 0 && r != -ENODATA)
return r;
if (r >= 0) {
+ _cleanup_ordered_set_free_free_ OrderedSet *multipath_routes = NULL;
MultipathRoute *mr;
r = rtattr_read_nexthop(rta_multipath, rta_len, family, &multipath_routes);