]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_bfd.c
*: Convert `struct event_master` to `struct event_loop`
[mirror_frr.git] / isisd / isis_bfd.c
index 1f50fb9342e46fe13ce4ce342d28f8850d477c4a..5e24e3521068c75e48baa6daabf7b05f6e4c0639 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - BFD support
  * Copyright (C) 2018 Christian Franke
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <zebra.h>
 
@@ -97,7 +84,7 @@ static void bfd_handle_adj_up(struct isis_adjacency *adj)
                family = AF_INET6;
                dst_ip.ipv6 = adj->ll_ipv6_addrs[0];
                local_ips = circuit->ipv6_link;
-               if (!local_ips || list_isempty(local_ips)) {
+               if (list_isempty(local_ips)) {
                        if (IS_DEBUG_BFD)
                                zlog_debug(
                                        "ISIS-BFD: skipping BFD initialization: IPv6 enabled and no local IPv6 addresses");
@@ -168,6 +155,8 @@ void isis_bfd_circuit_cmd(struct isis_circuit *circuit)
                        struct listnode *node;
                        struct isis_adjacency *adj;
 
+                       if (!adjdb)
+                               continue;
                        for (ALL_LIST_ELEMENTS_RO(adjdb, node, adj))
                                bfd_adj_cmd(adj);
                }
@@ -204,7 +193,7 @@ static int bfd_handle_circuit_add_addr(struct isis_circuit *circuit)
        struct isis_adjacency *adj;
        struct listnode *node;
 
-       if (circuit->area == 0)
+       if (circuit->area == NULL)
                return 0;
 
        for (ALL_LIST_ELEMENTS_RO(circuit->area->adjacency_list, node, adj)) {
@@ -220,7 +209,7 @@ static int bfd_handle_circuit_add_addr(struct isis_circuit *circuit)
        return 0;
 }
 
-void isis_bfd_init(struct thread_master *tm)
+void isis_bfd_init(struct event_loop *tm)
 {
        bfd_protocol_integration_init(zclient, tm);