diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-03-05 14:53:41 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-05 14:53:41 +0200 | 
| commit | fa5acd5a166d7f200d193b47a3cef90c6b616ca8 (patch) | |
| tree | c37e774c53612092311e240f0692151a897639e7 /zebra/dplane_fpm_nl.c | |
| parent | a44918640f8aa1a7b2626dc69eb385c7768a700b (diff) | |
| parent | e7a1fbbcf64659ae2057a2e1e20a6c1f842522ab (diff) | |
Merge pull request #15476 from donaldsharp/dplane_thread_issue_i_believe
zebra: fnc->obuf could be accessed without a lock
Diffstat (limited to 'zebra/dplane_fpm_nl.c')
| -rw-r--r-- | zebra/dplane_fpm_nl.c | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index 3e7e84edd2..245b799a91 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -1465,8 +1465,14 @@ static void fpm_process_queue(struct event *t)  	uint64_t processed_contexts = 0;  	while (true) { +		size_t writeable_amount; + +		frr_with_mutex (&fnc->obuf_mutex) { +			writeable_amount = STREAM_WRITEABLE(fnc->obuf); +		} +  		/* No space available yet. */ -		if (STREAM_WRITEABLE(fnc->obuf) < NL_PKT_BUF_SIZE) { +		if (writeable_amount < NL_PKT_BUF_SIZE) {  			no_bufs = true;  			break;  		}  | 
