mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 06:59:21 +00:00
zebra: set vrf as loopback upon interface add
Move setting vrf loopback flag on ifp after zebra vrf type is set (ziftype). Zebra connected not to announce unnumbered for VRF interface (similar to loopback). Ticket:CM-19914 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com
This commit is contained in:
parent
4012dd8880
commit
b0fa6f6a10
@ -73,7 +73,8 @@ static void connected_announce(struct interface *ifp, struct connected *ifc)
|
||||
if (!ifc)
|
||||
return;
|
||||
|
||||
if (!if_is_loopback(ifp) && ifc->address->family == AF_INET) {
|
||||
if (!if_is_loopback(ifp) && ifc->address->family == AF_INET &&
|
||||
!IS_ZEBRA_IF_VRF(ifp)) {
|
||||
if (ifc->address->prefixlen == 32)
|
||||
SET_FLAG(ifc->flags, ZEBRA_IFA_UNNUMBERED);
|
||||
else
|
||||
|
@ -649,8 +649,6 @@ static int netlink_interface(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
ifp = if_get_by_name(name, vrf_id, 0);
|
||||
set_ifindex(ifp, ifi->ifi_index, zns);
|
||||
ifp->flags = ifi->ifi_flags & 0x0000fffff;
|
||||
if (IS_ZEBRA_IF_VRF(ifp))
|
||||
SET_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);
|
||||
ifp->mtu6 = ifp->mtu = *(uint32_t *)RTA_DATA(tb[IFLA_MTU]);
|
||||
ifp->metric = 0;
|
||||
ifp->speed = get_iflink_speed(ifp);
|
||||
@ -661,6 +659,8 @@ static int netlink_interface(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
|
||||
/* Set zebra interface type */
|
||||
zebra_if_set_ziftype(ifp, zif_type, zif_slave_type);
|
||||
if (IS_ZEBRA_IF_VRF(ifp))
|
||||
SET_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);
|
||||
|
||||
/* Update link. */
|
||||
zebra_if_update_link(ifp, link_ifindex);
|
||||
@ -1143,15 +1143,15 @@ int netlink_link_change(struct sockaddr_nl *snl, struct nlmsghdr *h,
|
||||
/* Update interface information. */
|
||||
set_ifindex(ifp, ifi->ifi_index, zns);
|
||||
ifp->flags = ifi->ifi_flags & 0x0000fffff;
|
||||
if (IS_ZEBRA_IF_VRF(ifp))
|
||||
SET_FLAG(ifp->status,
|
||||
ZEBRA_INTERFACE_VRF_LOOPBACK);
|
||||
ifp->mtu6 = ifp->mtu = *(int *)RTA_DATA(tb[IFLA_MTU]);
|
||||
ifp->metric = 0;
|
||||
ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
|
||||
|
||||
/* Set interface type */
|
||||
zebra_if_set_ziftype(ifp, zif_type, zif_slave_type);
|
||||
if (IS_ZEBRA_IF_VRF(ifp))
|
||||
SET_FLAG(ifp->status,
|
||||
ZEBRA_INTERFACE_VRF_LOOPBACK);
|
||||
|
||||
/* Update link. */
|
||||
zebra_if_update_link(ifp, link_ifindex);
|
||||
|
Loading…
Reference in New Issue
Block a user