diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-01-19 10:02:23 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-01-19 10:02:23 +0000 |
commit | f0ba7fe55e73a015685e7426b555c4950877756f (patch) | |
tree | 9843a0d5988567f6bb9fdb60e6dac803080fbb21 /usr.sbin | |
parent | a6c6f76bbc3a501550ecfc390a263a3a380d0b4c (diff) |
Like in ospfd make the pkt_ptr a local static buffer.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ripd/packet.c | 3 | ||||
-rw-r--r-- | usr.sbin/ripd/ripe.c | 6 | ||||
-rw-r--r-- | usr.sbin/ripd/ripe.h | 4 |
3 files changed, 4 insertions, 9 deletions
diff --git a/usr.sbin/ripd/packet.c b/usr.sbin/ripd/packet.c index 01a4a3d572c..cc10965b1f5 100644 --- a/usr.sbin/ripd/packet.c +++ b/usr.sbin/ripd/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.13 2016/12/23 14:53:16 jca Exp $ */ +/* $OpenBSD: packet.c,v 1.14 2021/01/19 10:02:22 claudio Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -78,6 +78,7 @@ send_packet(struct iface *iface, void *pkt, size_t len, struct sockaddr_in *dst) void recv_packet(int fd, short event, void *bula) { + static char pkt_ptr[IBUF_READ_SIZE]; union { struct cmsghdr hdr; char buf[CMSG_SPACE(sizeof(struct sockaddr_dl))]; diff --git a/usr.sbin/ripd/ripe.c b/usr.sbin/ripd/ripe.c index 58aae5c7b3f..d49f87f155f 100644 --- a/usr.sbin/ripd/ripe.c +++ b/usr.sbin/ripd/ripe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ripe.c,v 1.26 2021/01/19 10:00:36 claudio Exp $ */ +/* $OpenBSD: ripe.c,v 1.27 2021/01/19 10:02:22 claudio Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -184,9 +184,6 @@ ripe(struct ripd_conf *xconf, int pipe_parent2ripe[2], int pipe_ripe2rde[2], /* listen on ripd control socket */ control_listen(); - if ((pkt_ptr = calloc(1, IBUF_READ_SIZE)) == NULL) - fatal("ripe"); - /* start interfaces */ LIST_FOREACH(iface, &xconf->iface_list, entry) { if_init(xconf, iface); @@ -483,7 +480,6 @@ ripe_shutdown(void) free(iev_rde); free(iev_main); free(oeconf); - free(pkt_ptr); log_info("rip engine exiting"); _exit(0); diff --git a/usr.sbin/ripd/ripe.h b/usr.sbin/ripd/ripe.h index 0adfc0b3487..860c3d943c0 100644 --- a/usr.sbin/ripd/ripe.h +++ b/usr.sbin/ripd/ripe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ripe.h,v 1.13 2021/01/19 10:00:36 claudio Exp $ */ +/* $OpenBSD: ripe.h,v 1.14 2021/01/19 10:02:22 claudio Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -25,8 +25,6 @@ #include <netinet/in.h> #include <netinet/ip.h> -u_int8_t *pkt_ptr; - /* neighbor events */ enum nbr_event { NBR_EVT_RESPONSE_RCVD, |