X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ldpd%2Fadjacency.c;h=42c3ef05351aec8855156e4b319bc0d2e48d9722;hb=32701c48d85074a8bb08196be129b429952e7d7d;hp=7eb5663492437cb21569d94f10fe334cef7c4dfe;hpb=b40a74fc2d73ee8394b7e82c8849b3886f94de2e;p=mirror_frr.git diff --git a/ldpd/adjacency.c b/ldpd/adjacency.c index 7eb566349..42c3ef053 100644 --- a/ldpd/adjacency.c +++ b/ldpd/adjacency.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: ISC /* $OpenBSD$ */ /* @@ -5,18 +6,6 @@ * Copyright (c) 2009 Michele Marchetto * Copyright (c) 2005 Claudio Jeker * Copyright (c) 2004, 2005, 2008 Esben Norby - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include @@ -181,7 +170,7 @@ static void adj_itimer(struct thread *thread) log_debug("%s: lsr-id %pI4", __func__, &adj->lsr_id); if (adj->source.type == HELLO_TARGETED) { - if (!(adj->source.target->flags & F_TNBR_CONFIGURED) && + if (!CHECK_FLAG(adj->source.target->flags, F_TNBR_CONFIGURED) && adj->source.target->pw_count == 0 && adj->source.target->rlfa_count == 0) { /* remove dynamic targeted neighbor */ @@ -196,7 +185,7 @@ static void adj_itimer(struct thread *thread) void adj_start_itimer(struct adj *adj) { - thread_cancel(&adj->inactivity_timer); + THREAD_OFF(adj->inactivity_timer); adj->inactivity_timer = NULL; thread_add_timer(master, adj_itimer, adj, adj->holdtime, &adj->inactivity_timer); @@ -205,7 +194,7 @@ adj_start_itimer(struct adj *adj) void adj_stop_itimer(struct adj *adj) { - thread_cancel(&adj->inactivity_timer); + THREAD_OFF(adj->inactivity_timer); } /* targeted neighbors */ @@ -256,7 +245,7 @@ tnbr_find(struct ldpd_conf *xconf, int af, union ldpd_addr *addr) struct tnbr * tnbr_check(struct ldpd_conf *xconf, struct tnbr *tnbr) { - if (!(tnbr->flags & (F_TNBR_CONFIGURED|F_TNBR_DYNAMIC)) && + if (!CHECK_FLAG(tnbr->flags, (F_TNBR_CONFIGURED|F_TNBR_DYNAMIC)) && tnbr->pw_count == 0 && tnbr->rlfa_count == 0) { tnbr_del(xconf, tnbr); return (NULL); @@ -354,7 +343,7 @@ static void tnbr_hello_timer(struct thread *thread) static void tnbr_start_hello_timer(struct tnbr *tnbr) { - thread_cancel(&tnbr->hello_timer); + THREAD_OFF(tnbr->hello_timer); tnbr->hello_timer = NULL; thread_add_timer(master, tnbr_hello_timer, tnbr, tnbr_get_hello_interval(tnbr), &tnbr->hello_timer); @@ -363,7 +352,7 @@ tnbr_start_hello_timer(struct tnbr *tnbr) static void tnbr_stop_hello_timer(struct tnbr *tnbr) { - thread_cancel(&tnbr->hello_timer); + THREAD_OFF(tnbr->hello_timer); } struct ctl_adj * @@ -386,9 +375,7 @@ adj_to_ctl(struct adj *adj) } actl.holdtime = adj->holdtime; actl.holdtime_remaining = - thread_is_scheduled(adj->inactivity_timer) - ? thread_timer_remain_second(adj->inactivity_timer) - : 0; + thread_timer_remain_second(adj->inactivity_timer); actl.trans_addr = adj->trans_addr; actl.ds_tlv = adj->ds_tlv;