Skip to content
Snippets Groups Projects
Commit fb39fb31 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

kxdpgun: fix error message if failed to get MAC

parent ed233acd
No related branches found
No related tags found
No related merge requests found
......@@ -598,11 +598,12 @@ static bool configure_target(char *target_str, char *local_ip, xdp_gun_ctx_t *ct
}
}
ret = ip_neigh_get(via.ss_family == AF_UNSPEC ? &ctx->target_ip : &via, true, ctx->target_mac);
const struct sockaddr_storage *neigh = via.ss_family == AF_UNSPEC ? &ctx->target_ip : &via;
ret = ip_neigh_get(neigh, true, ctx->target_mac);
if (ret < 0) {
char via_str[256] = { 0 };
(void)sockaddr_tostr(via_str, sizeof(via_str), &via);
printf("failed to get remote MAC of target/gateway `%s`: %s\n", via_str, strerror(-ret));
char neigh_str[256] = { 0 };
(void)sockaddr_tostr(neigh_str, sizeof(neigh_str), neigh);
printf("failed to get remote MAC of target/gateway `%s`: %s\n", neigh_str, strerror(-ret));
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment