diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-22 00:17:40 +0200 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-11-22 18:47:23 +0100 |
commit | 096f7609f9168ad1a2503acad31d3afc8f00f9e5 (patch) | |
tree | 7acf9cbf0f944b032da6a796fcf8d7f6a06fe90a /pbrd | |
parent | Merge pull request #10057 from ton31337/fix/we_shouldn_send_LLA_for_RS (diff) | |
download | frr-096f7609f9168ad1a2503acad31d3afc8f00f9e5.tar.xz frr-096f7609f9168ad1a2503acad31d3afc8f00f9e5.zip |
*: cleanup ifp->vrf_id
Since f60a1188 we store a pointer to the VRF in the interface structure.
There's no need anymore to store a separate vrf_id field.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'pbrd')
-rw-r--r-- | pbrd/pbr_vrf.c | 11 | ||||
-rw-r--r-- | pbrd/pbr_vrf.h | 1 | ||||
-rw-r--r-- | pbrd/pbr_vty.c | 10 | ||||
-rw-r--r-- | pbrd/pbr_zebra.c | 2 |
4 files changed, 4 insertions, 20 deletions
diff --git a/pbrd/pbr_vrf.c b/pbrd/pbr_vrf.c index 1b69e23ce..c3558ab59 100644 --- a/pbrd/pbr_vrf.c +++ b/pbrd/pbr_vrf.c @@ -92,17 +92,6 @@ static int pbr_vrf_delete(struct vrf *vrf) return 0; } -struct pbr_vrf *pbr_vrf_lookup_by_id(vrf_id_t vrf_id) -{ - struct vrf *vrf; - - vrf = vrf_lookup_by_id(vrf_id); - if (vrf) - return ((struct pbr_vrf *)vrf->info); - - return NULL; -} - struct pbr_vrf *pbr_vrf_lookup_by_name(const char *name) { struct vrf *vrf; diff --git a/pbrd/pbr_vrf.h b/pbrd/pbr_vrf.h index 5953387de..e37bcd42b 100644 --- a/pbrd/pbr_vrf.h +++ b/pbrd/pbr_vrf.h @@ -34,7 +34,6 @@ static inline vrf_id_t pbr_vrf_id(const struct pbr_vrf *pbr_vrf) return pbr_vrf->vrf->vrf_id; } -extern struct pbr_vrf *pbr_vrf_lookup_by_id(vrf_id_t vrf_id); extern struct pbr_vrf *pbr_vrf_lookup_by_name(const char *name); extern bool pbr_vrf_is_valid(const struct pbr_vrf *pbr_vrf); extern bool pbr_vrf_is_enabled(const struct pbr_vrf *pbr_vrf); diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c index cac056abd..dddca1d72 100644 --- a/pbrd/pbr_vty.c +++ b/pbrd/pbr_vty.c @@ -592,16 +592,12 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd, vty_out(vty, "You must specify the nexthop-vrf\n"); return CMD_WARNING_CONFIG_FAILED; } - if (ifp->vrf_id != vrf->vrf_id) { - struct vrf *actual; - - actual = vrf_lookup_by_id(ifp->vrf_id); + if (ifp->vrf->vrf_id != vrf->vrf_id) vty_out(vty, "Specified Intf %s is not in vrf %s but is in vrf %s, using actual vrf\n", - ifp->name, vrf->name, VRF_LOGNAME(actual)); - } + ifp->name, vrf->name, ifp->vrf->name); nhop.ifindex = ifp->ifindex; - nhop.vrf_id = ifp->vrf_id; + nhop.vrf_id = ifp->vrf->vrf_id; } if (addr) { diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index 8a9bb0201..b480d4072 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -513,7 +513,7 @@ pbr_encode_pbr_map_sequence_vrf(struct stream *s, struct pbr_vrf *pbr_vrf; if (pbrms->vrf_unchanged) - pbr_vrf = pbr_vrf_lookup_by_id(ifp->vrf_id); + pbr_vrf = ifp->vrf->info; else pbr_vrf = pbr_vrf_lookup_by_name(pbrms->vrf_name); |