diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-12-09 08:51:34 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-12-09 09:47:06 -0500 | 
| commit | cda0f501fb9a3b0dca429dac628ea4cc9566e233 (patch) | |
| tree | b525fd2539f8be3c174be8dad198a8a9f3012618 /zebra/zebra_routemap.c | |
| parent | b3faf1aab6029caf272475122fd99f7f0b0b39c9 (diff) | |
zebra: Free up routemap name memory on vrf deletion event
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_routemap.c')
| -rw-r--r-- | zebra/zebra_routemap.c | 17 | 
1 files changed, 17 insertions, 0 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 13d1995d58..066ef8a8d0 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -1818,6 +1818,23 @@ static void zebra_route_map_event(const char *rmap_name)  	route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);  } +void zebra_routemap_vrf_delete(struct zebra_vrf *zvrf) +{ +	afi_t afi; +	uint8_t type; + +	for (afi = AFI_IP; afi < AFI_MAX; afi++) { +		for (type = 0; type <= ZEBRA_ROUTE_MAX; type++) { +			if (PROTO_RM_NAME(zvrf, afi, type)) +				XFREE(MTYPE_ROUTE_MAP_NAME, +				      PROTO_RM_NAME(zvrf, afi, type)); +			if (NHT_RM_NAME(zvrf, afi, type)) +				XFREE(MTYPE_ROUTE_MAP_NAME, +				      NHT_RM_NAME(zvrf, afi, type)); +		} +	} +} +  /* ip protocol configuration write function */  void zebra_routemap_config_write_protocol(struct vty *vty,  					  struct zebra_vrf *zvrf)  | 
