]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/adjacency.c
Merge pull request #12920 from sri-mohan1/sri-mohan-ldp
[mirror_frr.git] / ldpd / adjacency.c
index bbc8a277a624d3434a163ae9189d6ccffcbb0956..42c3ef05351aec8855156e4b319bc0d2e48d9722 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * 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 <zebra.h>
@@ -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,7 +375,7 @@ adj_to_ctl(struct adj *adj)
        }
        actl.holdtime = adj->holdtime;
        actl.holdtime_remaining =
-           thread_timer_remain_second(adj->inactivity_timer);
+               thread_timer_remain_second(adj->inactivity_timer);
        actl.trans_addr = adj->trans_addr;
        actl.ds_tlv = adj->ds_tlv;