diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-01-19 09:37:54 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-01-19 09:37:54 +0000 |
commit | 3224d4122e0185f4e1232e622f55c6453ad13ea6 (patch) | |
tree | c5c4a0be3a52af56f41b72b235db58757d181c99 /usr.sbin/ospfd | |
parent | 60f38c57c870432522d9eee3f2d141d793c36986 (diff) |
Make the imsg event structures static, properly define ospfd_process and
rename nconf in the ospf engine to noeconf. This fixes the last common
symbols in ospfd.
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r-- | usr.sbin/ospfd/ospfd.c | 7 | ||||
-rw-r--r-- | usr.sbin/ospfd/ospfd.h | 7 | ||||
-rw-r--r-- | usr.sbin/ospfd/ospfe.c | 24 | ||||
-rw-r--r-- | usr.sbin/ospfd/rde.c | 6 |
4 files changed, 23 insertions, 21 deletions
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c index 0f8f0e8485e..1c76190d750 100644 --- a/usr.sbin/ospfd/ospfd.c +++ b/usr.sbin/ospfd/ospfd.c @@ -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; diff --git a/usr.sbin/ospfd/ospfd.h b/usr.sbin/ospfd/ospfd.h index 49a2c54fc03..81513223947 100644 --- a/usr.sbin/ospfd/ospfd.h +++ b/usr.sbin/ospfd/ospfd.h @@ -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; diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c index 451899ce58c..3e5cb5c33d7 100644 --- a/usr.sbin/ospfd/ospfe.c +++ b/usr.sbin/ospfd/ospfe.c @@ -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; diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index 040ba4545a9..6fe6badb62e 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -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; |