diff options
| author | fmihoub6WIND <farid.mihoub@yandex.com> | 2022-11-25 11:17:07 +0100 | 
|---|---|---|
| committer | Farid Mihoub <farid.mihoub@6wind.com> | 2023-09-29 08:24:18 +0200 | 
| commit | a4b3f0310855bcc7d834c5f069841a2dbb716feb (patch) | |
| tree | 7ff201650b69cd33511c470b02ecd81b8eb5b49a /zebra/label_manager.c | |
| parent | 2b8e22f264cc0529847ad640e8df90d62e751ee4 (diff) | |
zebra: delete label chunk upon release
In zebra/label_manager.c the releasing of the label chunk is done by
disowning the chunk to the system. The presence of this system label
chunk will cause label assignment to fail for this use case example:
label chunk ospf: 300-320
label chunk system: 510-520
label chunk isis: 1200-1300
Then we try to allocate the chunk 500-530, we get this error:
  "Allocation of mpls label chunk [500/530] failed"
The error is raised when the below condition is true:
    /* if chunk is used, cannot honor request */
      if (lmc->proto != NO_PROTO)
	      return NULL;
Delete the label chunk instead of disowning it when the label releasing
is done.
Signed-off-by: Farid MIHOUB <farid.mihoub@6wind.com>
Diffstat (limited to 'zebra/label_manager.c')
| -rw-r--r-- | zebra/label_manager.c | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/zebra/label_manager.c b/zebra/label_manager.c index bd0b53738c..0be0b4e732 100644 --- a/zebra/label_manager.c +++ b/zebra/label_manager.c @@ -98,7 +98,7 @@ void delete_label_chunk(void *val)   */  int release_daemon_label_chunks(struct zserv *client)  { -	struct listnode *node; +	struct listnode *node, *nnode;  	struct label_manager_chunk *lmc;  	int count = 0;  	int ret; @@ -108,7 +108,7 @@ int release_daemon_label_chunks(struct zserv *client)  			   __func__, zebra_route_string(client->proto),  			   client->instance, client->session_id); -	for (ALL_LIST_ELEMENTS_RO(lbl_mgr.lc_list, node, lmc)) { +	for (ALL_LIST_ELEMENTS(lbl_mgr.lc_list, node, nnode, lmc)) {  		if (lmc->proto == client->proto &&  		    lmc->instance == client->instance &&  		    lmc->session_id == client->session_id && lmc->keep == 0) { @@ -419,13 +419,14 @@ int release_label_chunk(uint8_t proto, unsigned short instance,  				 "%s: Daemon mismatch!!", __func__);  			continue;  		} -		lmc->proto = NO_PROTO; -		lmc->instance = 0; -		lmc->session_id = 0; -		lmc->keep = 0;  		ret = 0;  		break;  	} +	if (lmc) { +		list_delete_node(lbl_mgr.lc_list, node); +		delete_label_chunk(lmc); +	} +  	if (ret != 0)  		flog_err(EC_ZEBRA_LM_UNRELEASED_CHUNK,  			 "%s: Label chunk not released!!", __func__);  | 
