Use ospfe_imsg_compose_rde() instead of calling imsg_compose_event() with
authorclaudio <claudio@openbsd.org>
Tue, 19 Jan 2021 09:25:53 +0000 (09:25 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 19 Jan 2021 09:25:53 +0000 (09:25 +0000)
a local export of iev_rde. Remove the extern in preperation of -fno-common
cleanup.

usr.sbin/ospfd/lsreq.c
usr.sbin/ospfd/lsupdate.c

index ea52670..2c90e7c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: lsreq.c,v 1.21 2019/07/15 18:26:39 remi Exp $ */
+/*     $OpenBSD: lsreq.c,v 1.22 2021/01/19 09:25:53 claudio Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -27,8 +27,6 @@
 #include "log.h"
 #include "ospfe.h"
 
-extern struct imsgev           *iev_rde;
-
 /* link state request packet handling */
 int
 send_ls_req(struct nbr *nbr)
@@ -107,8 +105,7 @@ recv_ls_req(struct nbr *nbr, char *buf, u_int16_t len)
        case NBR_STA_XCHNG:
        case NBR_STA_LOAD:
        case NBR_STA_FULL:
-               imsg_compose_event(iev_rde, IMSG_LS_REQ, nbr->peerid,
-                   0, -1, buf, len);
+               ospfe_imsg_compose_rde(IMSG_LS_REQ, nbr->peerid, 0, buf, len);
                break;
        default:
                fatalx("recv_ls_req: unknown neighbor state");
index 2446a99..b057d1c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: lsupdate.c,v 1.48 2020/05/06 14:40:54 claudio Exp $ */
+/*     $OpenBSD: lsupdate.c,v 1.49 2021/01/19 09:25:53 claudio Exp $ */
 
 /*
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -32,9 +32,6 @@
 #include "ospfe.h"
 #include "rde.h"
 
-extern struct ospfd_conf       *oeconf;
-extern struct imsgev           *iev_rde;
-
 struct ibuf *prepare_ls_update(struct iface *);
 int    add_ls_update(struct ibuf *, struct iface *, void *, u_int16_t,
            u_int16_t);
@@ -276,8 +273,8 @@ recv_ls_update(struct nbr *nbr, char *buf, u_int16_t len)
                                    "neighbor ID %s", inet_ntoa(nbr->id));
                                return;
                        }
-                       imsg_compose_event(iev_rde, IMSG_LS_UPD, nbr->peerid, 0,
-                           -1, buf, ntohs(lsa.len));
+                       ospfe_imsg_compose_rde(IMSG_LS_UPD, nbr->peerid, 0,
+                           buf, ntohs(lsa.len));
                        buf += ntohs(lsa.len);
                        len -= ntohs(lsa.len);
                }