diff options
author | 2021-01-19 10:31:12 +0000 | |
---|---|---|
committer | 2021-01-19 10:31:12 +0000 | |
commit | 838745b6735eef86f5cec98987db37d4e28fc83b (patch) | |
tree | 56bd6c2b94689f902920df987502001e0db5baa4 | |
parent | Forgot one IBUF_READ_SIZE to READ_BUF_SIZE change. (diff) | |
download | wireguard-openbsd-838745b6735eef86f5cec98987db37d4e28fc83b.tar.xz wireguard-openbsd-838745b6735eef86f5cec98987db37d4e28fc83b.zip |
Like in ospfd use a static pkt_ptr buffer
-rw-r--r-- | usr.sbin/eigrpd/eigrpe.c | 6 | ||||
-rw-r--r-- | usr.sbin/eigrpd/eigrpe.h | 4 | ||||
-rw-r--r-- | usr.sbin/eigrpd/packet.c | 3 |
3 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/eigrpd/eigrpe.c b/usr.sbin/eigrpd/eigrpe.c index e22e7c7c959..63f53211dac 100644 --- a/usr.sbin/eigrpd/eigrpe.c +++ b/usr.sbin/eigrpd/eigrpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpe.c,v 1.36 2018/08/05 08:10:35 mestre Exp $ */ +/* $OpenBSD: eigrpe.c,v 1.37 2021/01/19 10:31:12 claudio Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -167,9 +167,6 @@ eigrpe(int debug, int verbose, char *sockname) TAILQ_INIT(&ctl_conns); control_listen(); - if ((pkt_ptr = calloc(1, READ_BUF_SIZE)) == NULL) - fatal("eigrpe"); - event_dispatch(); eigrpe_shutdown(); @@ -196,7 +193,6 @@ eigrpe_shutdown(void) /* clean up */ free(iev_rde); free(iev_main); - free(pkt_ptr); log_info("eigrp engine exiting"); exit(0); diff --git a/usr.sbin/eigrpd/eigrpe.h b/usr.sbin/eigrpd/eigrpe.h index f2825d37ca5..2d0198bc26a 100644 --- a/usr.sbin/eigrpd/eigrpe.h +++ b/usr.sbin/eigrpd/eigrpe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: eigrpe.h,v 1.16 2017/02/22 14:24:50 renato Exp $ */ +/* $OpenBSD: eigrpe.h,v 1.17 2021/01/19 10:31:12 claudio Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -180,6 +180,4 @@ void recv_query(struct nbr *, struct rinfo_head *, int); void send_reply(struct nbr *, struct rinfo_head *, int); void recv_reply(struct nbr *, struct rinfo_head *, int); -char *pkt_ptr; /* packet buffer */ - #endif /* _EIGRPE_H_ */ diff --git a/usr.sbin/eigrpd/packet.c b/usr.sbin/eigrpd/packet.c index 519dba6e22a..193e4aa6685 100644 --- a/usr.sbin/eigrpd/packet.c +++ b/usr.sbin/eigrpd/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.18 2016/09/02 16:44:33 renato Exp $ */ +/* $OpenBSD: packet.c,v 1.19 2021/01/19 10:31:12 claudio Exp $ */ /* * Copyright (c) 2015 Renato Westphal <renato@openbsd.org> @@ -467,6 +467,7 @@ error: void recv_packet(int fd, short event, void *bula) { + static char pkt_ptr[READ_BUF_SIZE]; union { struct cmsghdr hdr; char buf[CMSG_SPACE(CMSG_MAXLEN)]; |