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 /ripngd | |
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 'ripngd')
-rw-r--r-- | ripngd/ripng_interface.c | 16 | ||||
-rw-r--r-- | ripngd/ripng_routemap.c | 3 | ||||
-rw-r--r-- | ripngd/ripngd.c | 6 |
3 files changed, 16 insertions, 9 deletions
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index 49ed13a2c..520e19a71 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -212,7 +212,7 @@ int ripng_interface_up(ZAPI_CALLBACK_ARGS) if (IS_RIPNG_DEBUG_ZEBRA) zlog_debug( "interface up %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->mtu6); ripng_interface_sync(ifp); @@ -249,7 +249,7 @@ int ripng_interface_down(ZAPI_CALLBACK_ARGS) if (IS_RIPNG_DEBUG_ZEBRA) zlog_debug( "interface down %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->mtu6); return 0; @@ -266,7 +266,7 @@ int ripng_interface_add(ZAPI_CALLBACK_ARGS) if (IS_RIPNG_DEBUG_ZEBRA) zlog_debug( "RIPng 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->mtu6); /* Check is this interface is RIP enabled or not.*/ @@ -301,7 +301,7 @@ int ripng_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->mtu6); /* To support pseudo interface do not free interface structure. */ @@ -316,17 +316,21 @@ int ripng_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_RIPNG_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); + ripng_interface_sync(ifp); return 0; @@ -931,7 +935,7 @@ void ripng_interface_sync(struct interface *ifp) { struct vrf *vrf; - vrf = vrf_lookup_by_id(ifp->vrf_id); + vrf = ifp->vrf; if (vrf) { struct ripng_interface *ri; diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c index 0604e272c..874d81516 100644 --- a/ripngd/ripng_routemap.c +++ b/ripngd/ripng_routemap.c @@ -97,7 +97,8 @@ static route_map_result_t route_match_interface(void *rule, if (type == RMAP_RIPNG) { 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/ripngd/ripngd.c b/ripngd/ripngd.c index 3314892e7..34d8b3121 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2459,7 +2459,7 @@ static void ripng_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; @@ -2576,7 +2576,7 @@ static void ripng_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; @@ -2608,6 +2608,8 @@ void ripng_if_rmap_update_interface(struct interface *ifp) struct if_rmap *if_rmap; struct if_rmap_ctx *ctx; + if (ifp->vrf && ifp->vrf->vrf_id == VRF_UNKNOWN) + return; if (!ripng) return; ctx = ripng->if_rmap_ctx; |