diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-22 19:35:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-22 19:35:45 +0200 |
commit | a12bb225a6681b7e7eb0aac105cbc8b745675131 (patch) | |
tree | adb8d7935dcb1da93d6cf4082f903e412e292640 /ripd | |
parent | Merge pull request #4294 from adharkar/frr-master-fpm_rmac (diff) | |
parent | *: change interface structure, from vrf_id to vrf (diff) | |
download | frr-a12bb225a6681b7e7eb0aac105cbc8b745675131.tar.xz frr-a12bb225a6681b7e7eb0aac105cbc8b745675131.zip |
Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2
Ospf missing interface handling 2
Diffstat (limited to 'ripd')
-rw-r--r-- | ripd/rip_interface.c | 16 | ||||
-rw-r--r-- | ripd/rip_routemap.c | 3 | ||||
-rw-r--r-- | ripd/ripd.c | 6 |
3 files changed, 16 insertions, 9 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 80561f350..3a892f33b 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -366,7 +366,7 @@ int rip_interface_down(ZAPI_CALLBACK_ARGS) if (IS_RIP_DEBUG_ZEBRA) zlog_debug( "interface %s vrf %u index %d flags %llx metric %d mtu %d is down", - ifp->name, ifp->vrf_id, ifp->ifindex, + ifp->name, ifp->vrf->vrf_id, ifp->ifindex, (unsigned long long)ifp->flags, ifp->metric, ifp->mtu); return 0; @@ -387,7 +387,7 @@ int rip_interface_up(ZAPI_CALLBACK_ARGS) if (IS_RIP_DEBUG_ZEBRA) zlog_debug( "interface %s vrf %u index %d flags %#llx metric %d mtu %d is up", - ifp->name, ifp->vrf_id, ifp->ifindex, + ifp->name, ifp->vrf->vrf_id, ifp->ifindex, (unsigned long long)ifp->flags, ifp->metric, ifp->mtu); rip_interface_sync(ifp); @@ -415,7 +415,7 @@ int rip_interface_add(ZAPI_CALLBACK_ARGS) if (IS_RIP_DEBUG_ZEBRA) zlog_debug( "interface add %s vrf %u index %d flags %#llx metric %d mtu %d", - ifp->name, ifp->vrf_id, ifp->ifindex, + ifp->name, ifp->vrf->vrf_id, ifp->ifindex, (unsigned long long)ifp->flags, ifp->metric, ifp->mtu); /* Check if this interface is RIP enabled or not.*/ @@ -455,7 +455,7 @@ int rip_interface_delete(ZAPI_CALLBACK_ARGS) zlog_info( "interface delete %s vrf %u index %d flags %#llx metric %d mtu %d", - ifp->name, ifp->vrf_id, ifp->ifindex, + ifp->name, ifp->vrf->vrf_id, ifp->ifindex, (unsigned long long)ifp->flags, ifp->metric, ifp->mtu); /* To support pseudo interface do not free interface structure. */ @@ -470,17 +470,21 @@ int rip_interface_vrf_update(ZAPI_CALLBACK_ARGS) { struct interface *ifp; vrf_id_t new_vrf_id; + struct vrf *new_vrf; ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrf_id, &new_vrf_id); if (!ifp) return 0; + new_vrf = vrf_lookup_by_id(new_vrf_id); + if (IS_RIP_DEBUG_ZEBRA) zlog_debug("interface %s VRF change vrf_id %u new vrf id %u", ifp->name, vrf_id, new_vrf_id); - if_update_to_new_vrf(ifp, new_vrf_id); + if_update_to_new_vrf(ifp, new_vrf); + rip_interface_sync(ifp); return 0; @@ -1225,7 +1229,7 @@ void rip_interface_sync(struct interface *ifp) { struct vrf *vrf; - vrf = vrf_lookup_by_id(ifp->vrf_id); + vrf = ifp->vrf; if (vrf) { struct rip_interface *ri; diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c index 85d83c61d..b09af7e08 100644 --- a/ripd/rip_routemap.c +++ b/ripd/rip_routemap.c @@ -106,7 +106,8 @@ static route_map_result_t route_match_interface(void *rule, if (type == RMAP_RIP) { ifname = rule; - ifp = if_lookup_by_name(ifname, VRF_DEFAULT); + ifp = if_lookup_by_name(ifname, + vrf_lookup_by_id(VRF_DEFAULT)); if (!ifp) return RMAP_NOMATCH; diff --git a/ripd/ripd.c b/ripd/ripd.c index e0ff0430f..a859bcc43 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -3305,7 +3305,7 @@ static void rip_distribute_update(struct distribute_ctx *ctx, if (!ctx->vrf || !dist->ifname) return; - ifp = if_lookup_by_name(dist->ifname, ctx->vrf->vrf_id); + ifp = if_lookup_by_name(dist->ifname, ctx->vrf); if (ifp == NULL) return; @@ -3424,7 +3424,7 @@ static void rip_if_rmap_update(struct if_rmap_ctx *ctx, if (ctx->name) vrf = vrf_lookup_by_name(ctx->name); if (vrf) - ifp = if_lookup_by_name(if_rmap->ifname, vrf->vrf_id); + ifp = if_lookup_by_name(if_rmap->ifname, vrf); if (ifp == NULL) return; @@ -3457,6 +3457,8 @@ void rip_if_rmap_update_interface(struct interface *ifp) if (!rip) return; + if (ifp->vrf && ifp->vrf->vrf_id == VRF_UNKNOWN) + return; ctx = rip->if_rmap_ctx; if (!ctx) return; |