mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 23:54:45 +00:00
vrrpd: properly find iface in manual cfg mode
As a crutch, interface search when manually configuring VRRP on an interface did a prefix match on the name of macvlan interfaces, comparing its name to the name of the interface VRRP was configured on in order to determine if the interface under question was a subinterface of the configured interface. This is obviously fragile and prone to failure. We now pass up parent interface info from Zebra so use that instead to correctly deduce parent-child relationships. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
53e60e5c58
commit
1b1f3c43cf
@ -281,9 +281,8 @@ static bool vrrp_attach_interface(struct vrrp_router *r)
|
|||||||
r->vmac.octet, sizeof(r->vmac.octet), &ifps, VRF_DEFAULT);
|
r->vmac.octet, sizeof(r->vmac.octet), &ifps, VRF_DEFAULT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Filter to only those interfaces whose names begin with VRRP
|
* Filter to only those macvlan interfaces whose parent is the base
|
||||||
* interface name. E.g. if this VRRP instance was configured on eth0,
|
* interface this VRRP router is configured on.
|
||||||
* then we filter the list to only keep interfaces matching ^eth0.*
|
|
||||||
*
|
*
|
||||||
* If there are still multiple interfaces we just select the first one,
|
* If there are still multiple interfaces we just select the first one,
|
||||||
* as it should be functionally identical to the others.
|
* as it should be functionally identical to the others.
|
||||||
@ -291,8 +290,8 @@ static bool vrrp_attach_interface(struct vrrp_router *r)
|
|||||||
unsigned int candidates = 0;
|
unsigned int candidates = 0;
|
||||||
struct interface *selection = NULL;
|
struct interface *selection = NULL;
|
||||||
for (unsigned int i = 0; i < ifps_cnt; i++) {
|
for (unsigned int i = 0; i < ifps_cnt; i++) {
|
||||||
if (strncmp(ifps[i]->name, r->vr->ifp->name,
|
if (ifps[i]->link_ifindex != r->vr->ifp->ifindex
|
||||||
strlen(r->vr->ifp->name)))
|
|| !CHECK_FLAG(ifps[i]->flags, IFF_UP))
|
||||||
ifps[i] = NULL;
|
ifps[i] = NULL;
|
||||||
else {
|
else {
|
||||||
selection = selection ? selection : ifps[i];
|
selection = selection ? selection : ifps[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user