Skip to content
Snippets Groups Projects
Commit 3aabf792 authored by Marina Maslova's avatar Marina Maslova
Browse files

use bridge interface for arping if interface is in the bridge

In case of bridge kernel uses bridge MAC for regular packets.
arping doesn't check routing decision and in case of passing
interface from the bridge it will use interface MAC as source.
This might produce conflicting ARP entry on other side, because
same IP has bridge MAC and at the same time interface MAC which
might differ.
parent 993336a0
Branches
Tags
1 merge request!42use bridge interface for arping if interface is in the bridge
Pipeline #201132 passed
......@@ -493,14 +493,20 @@ static void neigh_probing_timer_run(atimer_t *t)
getcurrtime(&now);
list_for_each_entry(x, &e->iplist, list) {
char mifname[16] = {0};
char cmd[256] = {0};
char ipbuf[46] = {0};
int mifindex = 0;
if (x->ip.family != AF_INET)
continue;
inet_ntop(x->ip.family, &x->ip.addr, ipbuf, sizeof(ipbuf));
snprintf(cmd, 255, "arping -q -I %s -c 1 -w 1 -f %s &", e->ifname, ipbuf);
mifindex = if_isbridge_interface(e->ifname);
if (mifindex > 0 && if_indextoname(mifindex, mifname))
snprintf(cmd, 255, "arping -q -I %s -c 1 -w 1 -f %s &", mifname, ipbuf);
else
snprintf(cmd, 255, "arping -q -I %s -c 1 -w 1 -f %s &", e->ifname, ipbuf);
dbg("[%jd.%jd] %s\n", (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec, cmd);
runCmd(cmd); /* Flawfinder: ignore */
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment