mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 22:37:49 +00:00
zebra: fix ptm message processing
When PTM sends a "cbl status" message it specifies the interface name but not the VRF name. It is fine for VRF-lite, but doesn't work for netns because it's possible to have multiple interfaces with the same name. Be more restrictive in this case and return an error instead of randomly using of the interface with the specified name. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
4030e1867b
commit
f13fdc673c
@ -609,7 +609,17 @@ static int zebra_ptm_handle_msg_cb(void *arg, void *in_ctxt)
|
||||
}
|
||||
|
||||
if (strcmp(ZEBRA_PTM_INVALID_PORT_NAME, port_str)) {
|
||||
ifp = if_lookup_by_name_all_vrf(port_str);
|
||||
struct vrf *vrf;
|
||||
int count = 0;
|
||||
|
||||
RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
|
||||
ifp = if_lookup_by_name_vrf(ifname, vrf);
|
||||
if (ifp) {
|
||||
count++;
|
||||
if (!vrf_is_backend_netns())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ifp) {
|
||||
flog_warn(EC_ZEBRA_UNKNOWN_INTERFACE,
|
||||
@ -617,6 +627,12 @@ static int zebra_ptm_handle_msg_cb(void *arg, void *in_ctxt)
|
||||
__func__, port_str);
|
||||
return -1;
|
||||
}
|
||||
if (count > 1) {
|
||||
flog_warn(EC_ZEBRA_UNKNOWN_INTERFACE,
|
||||
"%s: multiple interface with name %s",
|
||||
__func__, port_str);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
ptm_lib_find_key_in_msg(in_ctxt, ZEBRA_PTM_CBL_STR, cbl_str);
|
||||
|
Loading…
Reference in New Issue
Block a user