diff --git a/eigrpe.c b/eigrpe.c index 61dfcab..4d19b57 100644 --- a/eigrpe.c +++ b/eigrpe.c @@ -42,7 +42,7 @@ __dead void eigrpe_shutdown(void); static struct event ev4; static struct event ev6; -struct eigrpd_conf *econf = NULL, *nconf; +struct eigrpd_conf *econf; struct imsgev *iev_main; struct imsgev *iev_rde; @@ -227,7 +227,8 @@ eigrpe_imsg_compose_rde(int type, uint32_t peerid, pid_t pid, void eigrpe_dispatch_main(int fd, short event, void *bula) { - static struct iface *niface = NULL; + static struct eigrpd_conf *nconf; + static struct iface *niface; static struct eigrp *neigrp; struct eigrp_iface *nei; struct imsg imsg; diff --git a/interface.c b/interface.c index fefb9f2..3a3ced3 100644 --- a/interface.c +++ b/interface.c @@ -50,8 +50,6 @@ RB_GENERATE(iface_id_head, eigrp_iface, id_tree, iface_id_compare) struct iface_id_head ifaces_by_id = RB_INITIALIZER(&ifaces_by_id); -static uint32_t ifacecnt = 1; - struct iface * if_new(struct eigrpd_conf *xconf, struct kif *kif) { @@ -294,6 +292,7 @@ eigrp_if_new(struct eigrpd_conf *xconf, struct eigrp *eigrp, struct kif *kif) { struct iface *iface; struct eigrp_iface *ei; + static uint32_t ifacecnt = 1; iface = if_lookup(xconf, kif->ifindex); if (iface == NULL) diff --git a/neighbor.c b/neighbor.c index 630a514..ad9c658 100644 --- a/neighbor.c +++ b/neighbor.c @@ -53,8 +53,6 @@ nbr_pid_compare(struct nbr *a, struct nbr *b) struct nbr_pid_head nbrs_by_pid = RB_INITIALIZER(&nbrs_by_pid); -uint32_t peercnt = NBR_CNTSTART; - extern struct eigrpd_conf *econf; struct nbr * @@ -150,6 +148,8 @@ nbr_del(struct nbr *nbr) void nbr_update_peerid(struct nbr *nbr) { + static uint32_t peercnt = NBR_CNTSTART; + if (nbr->peerid) RB_REMOVE(nbr_pid_head, &nbrs_by_pid, nbr); diff --git a/parse.y b/parse.y index 032bad4..ac522e1 100644 --- a/parse.y +++ b/parse.y @@ -79,11 +79,11 @@ uint32_t get_rtr_id(void); int get_prefix(const char *, union eigrpd_addr *, uint8_t *); static struct eigrpd_conf *conf; -static int errors = 0; +static int errors; -int af = AF_UNSPEC; -struct eigrp *eigrp = NULL; -struct eigrp_iface *ei = NULL; +int af; +struct eigrp *eigrp; +struct eigrp_iface *ei; struct config_defaults { uint8_t kvalues[6]; diff --git a/rde.c b/rde.c index e610ef0..3cab12a 100644 --- a/rde.c +++ b/rde.c @@ -40,7 +40,7 @@ __dead void rde_shutdown(void); void rde_dispatch_imsg(int, short, void *); void rde_dispatch_parent(int, short, void *); -struct eigrpd_conf *rdeconf = NULL, *nconf; +struct eigrpd_conf *rdeconf; struct imsgev *iev_eigrpe; struct imsgev *iev_main; @@ -304,7 +304,8 @@ rde_dispatch_imsg(int fd, short event, void *bula) void rde_dispatch_parent(int fd, short event, void *bula) { - static struct iface *niface = NULL; + static struct eigrpd_conf *nconf; + static struct iface *niface; static struct eigrp *neigrp; struct eigrp_iface *nei; struct imsg imsg;