diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-12-06 19:51:33 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-12-06 19:51:33 +0000 |
| commit | 6fd800be4ac4da8ec034f2a858e0183b8ae9bb01 (patch) | |
| tree | e1a77a68567f6496415b6476a6bed52c77d64619 /zebra/zebra_rnh.c | |
| parent | 3d6e734154e6da17423e9054b5443774cacfdd51 (diff) | |
| parent | 9dec6b446c5487623ad04fdaa8160e3338f12799 (diff) | |
Merge remote-tracking branch 'osr/master' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Conflicts:
lib/command_match.c
Diffstat (limited to 'zebra/zebra_rnh.c')
| -rw-r--r-- | zebra/zebra_rnh.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 062f9d3831..c4c11f98d9 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -56,7 +56,7 @@ static void copy_state(struct rnh *rnh, struct rib *rib, ({ \ struct zebra_vrf *zvrf; \ struct route_table *t = NULL; \ - zvrf = zebra_vrf_lookup(v); \ + zvrf = zebra_vrf_lookup_by_id(v); \ if (zvrf) \ t = zvrf->rnh_table[family2afi(f)]; \ t; \ @@ -76,7 +76,7 @@ static inline struct route_table *get_rnh_table(vrf_id_t vrfid, int family, struct zebra_vrf *zvrf; struct route_table *t = NULL; - zvrf = zebra_vrf_lookup(vrfid); + zvrf = zebra_vrf_lookup_by_id(vrfid); if (zvrf) switch (type) { @@ -163,6 +163,16 @@ zebra_lookup_rnh (struct prefix *p, vrf_id_t vrfid, rnh_type_t type) } void +zebra_free_rnh (struct rnh *rnh) +{ + rnh->flags |= ZEBRA_NHT_DELETED; + list_free (rnh->client_list); + list_free (rnh->zebra_static_route_list); + free_state (rnh->vrf_id, rnh->state, rnh->node); + XFREE (MTYPE_RNH, rnh); +} + +void zebra_delete_rnh (struct rnh *rnh, rnh_type_t type) { struct route_node *rn; @@ -177,14 +187,9 @@ zebra_delete_rnh (struct rnh *rnh, rnh_type_t type) rnh->vrf_id, rnh_str(rnh, buf, sizeof (buf)), type); } - rnh->flags |= ZEBRA_NHT_DELETED; - list_free(rnh->client_list); - list_free(rnh->zebra_static_route_list); - free_state(rnh->vrf_id, rnh->state, rn); - XFREE(MTYPE_RNH, rn->info); + zebra_free_rnh (rnh); rn->info = NULL; route_unlock_node (rn); - return; } void |
