diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-01-19 10:31:13 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-01-19 10:31:13 +0000 |
commit | 63efe746142bbd099cb54c2ac9a25b4b97086974 (patch) | |
tree | 414853d08c83c21e6466095e23fff27785284785 /usr.sbin/eigrpd | |
parent | 765ac2cd3372533df67c36ea1606a8031e738491 (diff) |
Like in ospfd use a static pkt_ptr buffer
Diffstat (limited to 'usr.sbin/eigrpd')
-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)]; |