diff --git a/zebra/connected.c b/zebra/connected.c index 404f892f6e5c..66d0561d6c6d 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -282,6 +282,15 @@ void connected_up(struct interface *ifp, struct connected *ifc) return; } + if (install_local) { + rib_add(afi, SAFI_UNICAST, zvrf->vrf->vrf_id, ZEBRA_ROUTE_LOCAL, + 0, flags, &plocal, NULL, &nh, 0, zvrf->table_id, 0, 0, + 0, 0, false); + rib_add(afi, SAFI_MULTICAST, zvrf->vrf->vrf_id, + ZEBRA_ROUTE_LOCAL, 0, flags, &plocal, NULL, &nh, 0, + zvrf->table_id, 0, 0, 0, 0, false); + } + if (!CHECK_FLAG(ifc->flags, ZEBRA_IFA_NOPREFIXROUTE)) { rib_add(afi, SAFI_UNICAST, zvrf->vrf->vrf_id, ZEBRA_ROUTE_CONNECT, 0, flags, &p, NULL, &nh, 0, @@ -292,15 +301,6 @@ void connected_up(struct interface *ifp, struct connected *ifc) zvrf->table_id, metric, 0, 0, 0, false); } - if (install_local) { - rib_add(afi, SAFI_UNICAST, zvrf->vrf->vrf_id, ZEBRA_ROUTE_LOCAL, - 0, flags, &plocal, NULL, &nh, 0, zvrf->table_id, 0, 0, - 0, 0, false); - rib_add(afi, SAFI_MULTICAST, zvrf->vrf->vrf_id, - ZEBRA_ROUTE_LOCAL, 0, flags, &plocal, NULL, &nh, 0, - zvrf->table_id, 0, 0, 0, 0, false); - } - /* Schedule LSP forwarding entries for processing, if appropriate. */ if (zvrf->vrf->vrf_id == VRF_DEFAULT) { if (IS_ZEBRA_DEBUG_MPLS)