diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2022-06-03 10:59:31 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2022-07-21 08:30:49 -0400 |
| commit | c3aaa89a442a43fbaf2ef9dce6422f57a58e52b0 (patch) | |
| tree | 752d2f7d9e95c1dbbc13993b681cd5a40b44bd27 /bgpd/rfapi/rfapi_import.c | |
| parent | fa5806c3183ae685d96255bca3474026390335a2 (diff) | |
bgpd: Convert thread_cancel to THREAD_OFF and use THREAD_ARG
Just convert all uses of thread_cancel to THREAD_OFF. Additionally
use THREAD_ARG instead of t->arg to get the arguement. Individual
files should never be accessing thread private data like this.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/rfapi/rfapi_import.c')
| -rw-r--r-- | bgpd/rfapi/rfapi_import.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 91b68b13d8..1d42702769 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -856,13 +856,11 @@ static void rfapiBgpInfoChainFree(struct bgp_path_info *bpi) */ if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra->vnc.import.timer) { - - struct thread **t = - &(bpi->extra->vnc.import.timer); - struct rfapi_withdraw *wcb = (*t)->arg; + struct rfapi_withdraw *wcb = + THREAD_ARG(bpi->extra->vnc.import.timer); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - thread_cancel(t); + THREAD_OFF(bpi->extra->vnc.import.timer); } next = bpi->next; @@ -2371,7 +2369,7 @@ static void rfapiMonitorEncapDelete(struct bgp_path_info *vpn_bpi) */ static void rfapiWithdrawTimerVPN(struct thread *t) { - struct rfapi_withdraw *wcb = t->arg; + struct rfapi_withdraw *wcb = THREAD_ARG(t); struct bgp_path_info *bpi = wcb->info; struct bgp *bgp = bgp_get_default(); const struct prefix *p; @@ -2672,7 +2670,7 @@ rfapiWithdrawEncapUpdateCachedUn(struct rfapi_import_table *import_table, static void rfapiWithdrawTimerEncap(struct thread *t) { - struct rfapi_withdraw *wcb = t->arg; + struct rfapi_withdraw *wcb = THREAD_ARG(t); struct bgp_path_info *bpi = wcb->info; int was_first_route = 0; struct rfapi_monitor_encap *em; @@ -3089,13 +3087,12 @@ static void rfapiBgpInfoFilteredImportEncap( */ if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra->vnc.import.timer) { - - struct thread **t = - &(bpi->extra->vnc.import.timer); - struct rfapi_withdraw *wcb = (*t)->arg; + struct rfapi_withdraw *wcb = THREAD_ARG( + bpi->extra->vnc.import.timer); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - thread_cancel(t); + THREAD_OFF( + bpi->extra->vnc.import.timer); } if (action == FIF_ACTION_UPDATE) { @@ -3182,12 +3179,11 @@ static void rfapiBgpInfoFilteredImportEncap( "%s: removing holddown bpi matching NVE of new route", __func__); if (bpi->extra->vnc.import.timer) { - struct thread **t = - &(bpi->extra->vnc.import.timer); - struct rfapi_withdraw *wcb = (*t)->arg; + struct rfapi_withdraw *wcb = + THREAD_ARG(bpi->extra->vnc.import.timer); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - thread_cancel(t); + THREAD_OFF(bpi->extra->vnc.import.timer); } rfapiExpireEncapNow(import_table, rn, bpi); } @@ -3543,13 +3539,12 @@ void rfapiBgpInfoFilteredImportVPN( */ if (CHECK_FLAG(bpi->flags, BGP_PATH_REMOVED) && bpi->extra->vnc.import.timer) { - - struct thread **t = - &(bpi->extra->vnc.import.timer); - struct rfapi_withdraw *wcb = (*t)->arg; + struct rfapi_withdraw *wcb = THREAD_ARG( + bpi->extra->vnc.import.timer); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - thread_cancel(t); + THREAD_OFF( + bpi->extra->vnc.import.timer); import_table->holddown_count[afi] -= 1; RFAPI_UPDATE_ITABLE_COUNT( @@ -3762,12 +3757,11 @@ void rfapiBgpInfoFilteredImportVPN( "%s: removing holddown bpi matching NVE of new route", __func__); if (bpi->extra->vnc.import.timer) { - struct thread **t = - &(bpi->extra->vnc.import.timer); - struct rfapi_withdraw *wcb = (*t)->arg; + struct rfapi_withdraw *wcb = + THREAD_ARG(bpi->extra->vnc.import.timer); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - thread_cancel(t); + THREAD_OFF(bpi->extra->vnc.import.timer); } rfapiExpireVpnNow(import_table, rn, bpi, 0); } @@ -4490,12 +4484,11 @@ static void rfapiDeleteRemotePrefixesIt( if (!delete_holddown) continue; if (bpi->extra->vnc.import.timer) { - - struct thread **t = - &(bpi->extra->vnc - .import.timer); struct rfapi_withdraw *wcb = - (*t)->arg; + THREAD_ARG( + bpi->extra->vnc + .import + .timer); wcb->import_table ->holddown_count[afi] -= @@ -4505,7 +4498,9 @@ static void rfapiDeleteRemotePrefixesIt( afi, 1); XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - thread_cancel(t); + THREAD_OFF( + bpi->extra->vnc.import + .timer); } } else { if (!delete_active) |
