Skip to content
Snippets Groups Projects
Commit c10e90b3 authored by Libor Peltan's avatar Libor Peltan Committed by Daniel Salzman
Browse files

xdp-gun: routing to loopback iface

parent 65591945
No related branches found
No related tags found
1 merge request!1149Xdp gun popen fix
......@@ -405,6 +405,13 @@ static int remoteIP2MAC(const char *ip_str, bool ipv6, char devname[], uint8_t r
static int distantIP2MAC(const char *ip_str, bool ipv6, char devname[], uint8_t remote_mac[])
{
if ((!ipv6 && strncmp(ip_str, "127.", 4) == 0) ||
(ipv6 && strcmp(ip_str, "::1") == 0)) {
strcpy(devname, "lo");
memset(remote_mac, 0, 6);
return KNOT_EOK;
}
char *via = NULL;
int ret = ip_route_get(ip_str, "via", &via);
switch (ret) {
......
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