diff options
| author | Mark Stapp <mjs@voltanet.io> | 2021-10-19 16:46:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-19 16:46:58 -0400 |
| commit | 32c8a3c2ae48d85bd855b0ebb55c426121be843a (patch) | |
| tree | 2b489718f0d61ed4c5b043959bcbe3e18035d874 /zebra/interface.c | |
| parent | e9f7b2b597ad8c6947ce3b7238e89391e4f9f863 (diff) | |
| parent | f60a11883cb426f574dbe5abeff8254148e7c371 (diff) | |
Merge pull request #9818 from idryzhov/lib-if-fixes
lib: allow to create interfaces in non-existing VRFs
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index a68d00d55c..595862a6c9 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1616,7 +1616,6 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) struct listnode *node; struct route_node *rn; struct zebra_if *zebra_if; - struct vrf *vrf; char pd_buf[ZEBRA_PROTODOWN_RC_STR_LEN]; zebra_if = ifp->info; @@ -1644,8 +1643,7 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) zebra_ptm_show_status(vty, NULL, ifp); - vrf = vrf_lookup_by_id(ifp->vrf_id); - vty_out(vty, " vrf: %s\n", vrf->name); + vty_out(vty, " vrf: %s\n", ifp->vrf->name); if (ifp->desc) vty_out(vty, " Description: %s\n", ifp->desc); @@ -1941,7 +1939,6 @@ static void if_dump_vty_json(struct vty *vty, struct interface *ifp, struct listnode *node; struct route_node *rn; struct zebra_if *zebra_if; - struct vrf *vrf; char pd_buf[ZEBRA_PROTODOWN_RC_STR_LEN]; char buf[BUFSIZ]; json_object *json_if; @@ -1979,8 +1976,7 @@ static void if_dump_vty_json(struct vty *vty, struct interface *ifp, zebra_ptm_show_status(vty, json, ifp); - vrf = vrf_lookup_by_id(ifp->vrf_id); - json_object_string_add(json_if, "vrfName", vrf->name); + json_object_string_add(json_if, "vrfName", ifp->vrf->name); if (ifp->desc) json_object_string_add(json_if, "description", ifp->desc); @@ -4206,21 +4202,19 @@ static int link_params_config_write(struct vty *vty, struct interface *ifp) static int if_config_write(struct vty *vty) { - struct vrf *vrf0; + struct vrf *vrf; struct interface *ifp; zebra_ptm_write(vty); - RB_FOREACH (vrf0, vrf_name_head, &vrfs_by_name) - FOR_ALL_INTERFACES (vrf0, ifp) { + RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) + FOR_ALL_INTERFACES (vrf, ifp) { struct zebra_if *if_data; struct listnode *addrnode; struct connected *ifc; struct prefix *p; - struct vrf *vrf; if_data = ifp->info; - vrf = vrf_lookup_by_id(ifp->vrf_id); if (ifp->vrf_id == VRF_DEFAULT) vty_frame(vty, "interface %s\n", ifp->name); |
