Skip to content
Snippets Groups Projects
Commit b08b5397 authored by Balalakshmi Arunachalam Rajendran's avatar Balalakshmi Arunachalam Rajendran
Browse files

Fix for ethernet host under correct node

parent 993336a0
Branches neigh_ethhost
No related tags found
1 merge request!33Draft: Fix for ethernet host under correct node
Pipeline #177623 passed
......@@ -154,21 +154,43 @@ int hostmngr_update_neigh_brport(struct hostmngr_private *priv, char *brname)
for (i = 0; i < num; i++) {
struct neigh_entry *t;
char *ifname = NULL;
dbg("FDB[%d] : " MACFMT " port = %hu\n", i,
MAC2STR(fdbs[i].macaddr), fdbs[i].port);
t = neigh_lookup(&priv->neigh_q, fdbs[i].macaddr);
ifname = hostmngr_brport_to_ifname(priv, fdbs[i].port);
if (t) {
t->brport = fdbs[i].port;
char *ifname;
ifname = hostmngr_brport_to_ifname(priv, fdbs[i].port);
if (ifname) {
memset(t->ifname, 0, 16);
strncpy(t->ifname, ifname, 16);
}
}
else {
/* create a new neigh just learnt from br-fdb */
struct neigh_entry *new = NULL;
enum if_mediatype mtype;
if (ifname) {
if_getmediatype(ifname, &mtype);
if (mtype == IF_MEDIA_ETH) {
new = neigh_enqueue(&priv->neigh_q,
fdbs[i].macaddr,
NEIGH_STATE_REACHABLE,
ifname,
NEIGH_TYPE_ETH,
NULL,
NEIGH_AGEOUT_DEFAULT,
NULL);
if (new) {
new->brport = fdbs[i].port;
dbg("%s: Added new neighbor: " MACFMT " on port %hu\n", __func__, MAC2STR(fdbs[i].macaddr), fdbs[i].port);
}
}
}
}
}
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment