summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-01-19 09:43:41 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-01-19 09:43:41 +0000
commit7ddd8614c5b5aabbaf4fb932101fa1ed049c823e (patch)
treedc5447d00c2128997affba87c61952f929982339 /usr.sbin/ospf6d
parentf00313276486b6e51c72bee0fef827a8e8258908 (diff)
Like in ospfd use a static pkt_ptr buffer.
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r--usr.sbin/ospf6d/ospfe.c6
-rw-r--r--usr.sbin/ospf6d/ospfe.h4
-rw-r--r--usr.sbin/ospf6d/packet.c3
3 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c
index 69f91d026fe..7fd8675cb6f 100644
--- a/usr.sbin/ospf6d/ospfe.c
+++ b/usr.sbin/ospf6d/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.64 2021/01/19 09:42:11 claudio Exp $ */
+/* $OpenBSD: ospfe.c,v 1.65 2021/01/19 09:43:40 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -174,9 +174,6 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2],
/* remove unneeded config stuff */
conf_clear_redist_list(&oeconf->redist_list);
- if ((pkt_ptr = calloc(1, READ_BUF_SIZE)) == NULL)
- fatal("ospfe");
-
/* start interfaces */
LIST_FOREACH(area, &oeconf->area_list, entry) {
ospfe_demote_area(area, 0);
@@ -223,7 +220,6 @@ ospfe_shutdown(void)
free(iev_rde);
free(iev_main);
free(oeconf);
- free(pkt_ptr);
log_info("ospf engine exiting");
_exit(0);
diff --git a/usr.sbin/ospf6d/ospfe.h b/usr.sbin/ospf6d/ospfe.h
index ec46bdc3ffc..7fec5f8df85 100644
--- a/usr.sbin/ospf6d/ospfe.h
+++ b/usr.sbin/ospf6d/ospfe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.h,v 1.24 2021/01/19 09:42:11 claudio Exp $ */
+/* $OpenBSD: ospfe.h,v 1.25 2021/01/19 09:43:40 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -231,6 +231,4 @@ int upd_ospf_hdr(struct ibuf *, struct iface *);
int send_packet(struct iface *, struct ibuf *, struct in6_addr *);
void recv_packet(int, short, void *);
-char *pkt_ptr; /* packet buffer */
-
#endif /* _OSPFE_H_ */
diff --git a/usr.sbin/ospf6d/packet.c b/usr.sbin/ospf6d/packet.c
index 6d36534cc19..efbf891df1d 100644
--- a/usr.sbin/ospf6d/packet.c
+++ b/usr.sbin/ospf6d/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.18 2021/01/12 09:54:44 claudio Exp $ */
+/* $OpenBSD: packet.c,v 1.19 2021/01/19 09:43:40 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -114,6 +114,7 @@ send_packet(struct iface *iface, struct ibuf *buf,
void
recv_packet(int fd, short event, void *bula)
{
+ static char pkt_ptr[READ_BUF_SIZE];
union {
struct cmsghdr hdr;
char buf[CMSG_SPACE(sizeof(struct in6_pktinfo))];