summaryrefslogtreecommitdiff
path: root/bgpd/rfapi/rfapi_import.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/rfapi/rfapi_import.c')
-rw-r--r--bgpd/rfapi/rfapi_import.c57
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)