Make the imsg event structures static, properly define ospfd_process and
authorclaudio <claudio@openbsd.org>
Tue, 19 Jan 2021 09:37:53 +0000 (09:37 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 19 Jan 2021 09:37:53 +0000 (09:37 +0000)
rename nconf in the ospf engine to noeconf. This fixes the last common
symbols in ospfd.

usr.sbin/ospfd/ospfd.c
usr.sbin/ospfd/ospfd.h
usr.sbin/ospfd/ospfe.c
usr.sbin/ospfd/rde.c

index 0f8f0e8..1c76190 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ospfd.c,v 1.114 2020/09/16 20:50:10 remi Exp $ */
+/*     $OpenBSD: ospfd.c,v 1.115 2021/01/19 09:37:53 claudio Exp $ */
 
 /*
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -64,9 +64,10 @@ int  pipe_parent2ospfe[2];
 int    pipe_parent2rde[2];
 int    pipe_ospfe2rde[2];
 
+enum ospfd_process      ospfd_process;
 struct ospfd_conf      *ospfd_conf = NULL;
-struct imsgev          *iev_ospfe;
-struct imsgev          *iev_rde;
+static struct imsgev   *iev_ospfe;
+static struct imsgev   *iev_rde;
 char                   *conffile;
 
 pid_t                   ospfe_pid = 0;
index 49a2c54..8151322 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ospfd.h,v 1.107 2020/11/02 00:30:56 dlg Exp $ */
+/*     $OpenBSD: ospfd.h,v 1.108 2021/01/19 09:37:53 claudio Exp $ */
 
 /*
  * Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -374,11 +374,12 @@ struct ifaddrchange {
 };
 
 /* ospf_conf */
-enum {
+enum ospfd_process {
        PROC_MAIN,
        PROC_OSPF_ENGINE,
        PROC_RDE_ENGINE
-} ospfd_process;
+};
+extern enum ospfd_process ospfd_process;
 
 struct ospfd_conf {
        struct event            ev;
index 451899c..3e5cb5c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ospfe.c,v 1.109 2021/01/19 09:33:38 claudio Exp $ */
+/*     $OpenBSD: ospfe.c,v 1.110 2021/01/19 09:37:53 claudio Exp $ */
 
 /*
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -47,9 +47,9 @@ __dead void    ospfe_shutdown(void);
 void            orig_rtr_lsa_all(struct area *);
 struct iface   *find_vlink(struct abr_rtr *);
 
-struct ospfd_conf      *oeconf = NULL, *nconf;
-struct imsgev          *iev_main;
-struct imsgev          *iev_rde;
+struct ospfd_conf      *oeconf = NULL, *noeconf;
+static struct imsgev   *iev_main;
+static struct imsgev   *iev_rde;
 int                     oe_nofib;
 
 /* ARGSUSED */
@@ -399,13 +399,13 @@ ospfe_dispatch_main(int fd, short event, void *bula)
                        }
                        break;
                case IMSG_RECONF_CONF:
-                       if ((nconf = malloc(sizeof(struct ospfd_conf))) ==
+                       if ((noeconf = malloc(sizeof(struct ospfd_conf))) ==
                            NULL)
                                fatal(NULL);
-                       memcpy(nconf, imsg.data, sizeof(struct ospfd_conf));
+                       memcpy(noeconf, imsg.data, sizeof(struct ospfd_conf));
 
-                       LIST_INIT(&nconf->area_list);
-                       LIST_INIT(&nconf->cand_list);
+                       LIST_INIT(&noeconf->area_list);
+                       LIST_INIT(&noeconf->cand_list);
                        break;
                case IMSG_RECONF_AREA:
                        if ((narea = area_new()) == NULL)
@@ -417,7 +417,7 @@ ospfe_dispatch_main(int fd, short event, void *bula)
                        RB_INIT(&narea->lsa_tree);
                        SIMPLEQ_INIT(&narea->redist_list);
 
-                       LIST_INSERT_HEAD(&nconf->area_list, narea, entry);
+                       LIST_INSERT_HEAD(&noeconf->area_list, narea, entry);
                        break;
                case IMSG_RECONF_IFACE:
                        if ((niface = malloc(sizeof(struct iface))) == NULL)
@@ -438,12 +438,12 @@ ospfe_dispatch_main(int fd, short event, void *bula)
                        break;
                case IMSG_RECONF_END:
                        if ((oeconf->flags & OSPFD_FLAG_STUB_ROUTER) !=
-                           (nconf->flags & OSPFD_FLAG_STUB_ROUTER))
+                           (noeconf->flags & OSPFD_FLAG_STUB_ROUTER))
                                stub_changed = 1;
                        else
                                stub_changed = 0;
-                       merge_config(oeconf, nconf);
-                       nconf = NULL;
+                       merge_config(oeconf, noeconf);
+                       noeconf = NULL;
                        if (stub_changed)
                                orig_rtr_lsa_all(NULL);
                        break;
index 040ba45..6fe6bad 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rde.c,v 1.110 2019/11/19 09:55:55 remi Exp $ */
+/*     $OpenBSD: rde.c,v 1.111 2021/01/19 09:37:53 claudio Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -65,8 +65,8 @@ struct lsa    *orig_asext_lsa(struct kroute *, u_int32_t, u_int16_t);
 struct lsa     *orig_sum_lsa(struct rt_node *, struct area *, u_int8_t, int);
 
 struct ospfd_conf      *rdeconf = NULL, *nconf = NULL;
-struct imsgev          *iev_ospfe;
-struct imsgev          *iev_main;
+static struct imsgev   *iev_ospfe;
+static struct imsgev   *iev_main;
 struct rde_nbr         *nbrself;
 struct lsa_tree                 asext_tree;