]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/lde.c
bgpd: Give better debug message when configuration is being read in
[mirror_frr.git] / ldpd / lde.c
index 55fa806d4db23b196d8910f20e34eebe4dbd96ec..edd13fed3599df2349871e6ad3828dddeb45f594 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: ISC
 /*     $OpenBSD$ */
 
 /*
@@ -5,18 +6,6 @@
  * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2004 Esben Norby <norby@openbsd.org>
  * Copyright (c) 2003, 2004 Henning Brauer <henning@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>
@@ -41,8 +30,8 @@
 #include "libfrr.h"
 
 static void             lde_shutdown(void);
-static int              lde_dispatch_imsg(struct thread *);
-static int              lde_dispatch_parent(struct thread *);
+static void lde_dispatch_imsg(struct thread *thread);
+static void lde_dispatch_parent(struct thread *thread);
 static __inline        int      lde_nbr_compare(const struct lde_nbr *,
                            const struct lde_nbr *);
 static struct lde_nbr  *lde_nbr_new(uint32_t, struct lde_nbr *);
@@ -243,8 +232,7 @@ lde_imsg_compose_ldpe(int type, uint32_t peerid, pid_t pid, void *data,
 }
 
 /* ARGSUSED */
-static int
-lde_dispatch_imsg(struct thread *thread)
+static void lde_dispatch_imsg(struct thread *thread)
 {
        struct imsgev           *iev = THREAD_ARG(thread);
        struct imsgbuf          *ibuf = &iev->ibuf;
@@ -418,17 +406,14 @@ lde_dispatch_imsg(struct thread *thread)
                imsg_event_add(iev);
        else {
                /* this pipe is dead, so remove the event handlers and exit */
-               thread_cancel(&iev->ev_read);
-               thread_cancel(&iev->ev_write);
+               THREAD_OFF(iev->ev_read);
+               THREAD_OFF(iev->ev_write);
                lde_shutdown();
        }
-
-       return (0);
 }
 
 /* ARGSUSED */
-static int
-lde_dispatch_parent(struct thread *thread)
+static void lde_dispatch_parent(struct thread *thread)
 {
        static struct ldpd_conf *nconf;
        struct iface            *iface, *niface;
@@ -706,12 +691,10 @@ lde_dispatch_parent(struct thread *thread)
                imsg_event_add(iev);
        else {
                /* this pipe is dead, so remove the event handlers and exit */
-               thread_cancel(&iev->ev_read);
-               thread_cancel(&iev->ev_write);
+               THREAD_OFF(iev->ev_read);
+               THREAD_OFF(iev->ev_write);
                lde_shutdown();
        }
-
-       return (0);
 }
 
 int
@@ -766,7 +749,7 @@ lde_update_label(struct fec_node *fn)
                    fn->fec.u.ipv6.prefixlen) != FILTER_PERMIT)
                        return (NO_LABEL);
                break;
-       default:
+       case FEC_TYPE_PWID:
                break;
        }
 
@@ -796,7 +779,7 @@ lde_update_label(struct fec_node *fn)
                            fn->fec.u.ipv6.prefixlen) != FILTER_PERMIT)
                                return (MPLS_LABEL_IMPLICIT_NULL);
                        return MPLS_LABEL_IPV6_EXPLICIT_NULL;
-               default:
+               case FEC_TYPE_PWID:
                        break;
                }
        }
@@ -935,7 +918,7 @@ lde_fec2prefix(const struct fec *fec, struct prefix *prefix)
                prefix->u.prefix6 = fec->u.ipv6.prefix;
                prefix->prefixlen = fec->u.ipv6.prefixlen;
                break;
-       default:
+       case FEC_TYPE_PWID:
                prefix->family = AF_UNSPEC;
                break;
        }
@@ -1320,7 +1303,7 @@ lde_send_labelrequest(struct lde_nbr *ln, struct fec_node *fn,
                        if (!ln->v6_enabled)
                                return;
                        break;
-               default:
+               case FEC_TYPE_PWID:
                        fatalx("lde_send_labelrequest: unknown af");
                }
        } else
@@ -1601,7 +1584,7 @@ lde_nbr_addr_update(struct lde_nbr *ln, struct lde_addr *lde_addr, int removed)
                        if (lde_addr->af != AF_INET6)
                                continue;
                        break;
-               default:
+               case FEC_TYPE_PWID:
                        continue;
                }
 
@@ -2173,11 +2156,9 @@ lde_address_list_free(struct lde_nbr *ln)
 /*
  * Event callback used to retry the label-manager sync zapi session.
  */
-static int zclient_sync_retry(struct thread *thread)
+static void zclient_sync_retry(struct thread *thread)
 {
        zclient_sync_init();
-
-       return 0;
 }
 
 /*