summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/ospfe.c
diff options
context:
space:
mode:
authorEsben Norby <norby@cvs.openbsd.org>2006-02-19 18:52:07 +0000
committerEsben Norby <norby@cvs.openbsd.org>2006-02-19 18:52:07 +0000
commit2e6ac6d7457d700f5de16f5fbdda7a24903d06b4 (patch)
tree61920e5048e696dfeefd0cedb0d2de1cbadb1f2d /usr.sbin/ospfd/ospfe.c
parent46ba324f6859f405726b929bc7af473bfdd4e0be (diff)
Do not allocate a new chunk of memory every time we receive a packet.
This should have been fixed ages ago since it really improves the performance of ospfd. ok claudio@
Diffstat (limited to 'usr.sbin/ospfd/ospfe.c')
-rw-r--r--usr.sbin/ospfd/ospfe.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c
index 956d39953a9..37bbca7d7f2 100644
--- a/usr.sbin/ospfd/ospfe.c
+++ b/usr.sbin/ospfd/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.38 2006/02/10 18:30:47 claudio Exp $ */
+/* $OpenBSD: ospfe.c,v 1.39 2006/02/19 18:52:06 norby Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -170,6 +170,9 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2],
TAILQ_INIT(&ctl_conns);
control_listen();
+ if ((pkt_ptr = calloc(1, READ_BUF_SIZE)) == NULL)
+ fatal("ospfe");
+
/* start interfaces */
LIST_FOREACH(area, &oeconf->area_list, entry) {
LIST_FOREACH(iface, &area->iface_list, entry) {
@@ -216,6 +219,7 @@ ospfe_shutdown(void)
msgbuf_clear(&ibuf_main->w);
free(ibuf_main);
free(oeconf);
+ free(pkt_ptr);
log_info("ospf engine exiting");
_exit(0);
@@ -715,7 +719,7 @@ orig_rtr_lsa(struct area *area)
(iface->linkstate != LINK_STATE_UP &&
iface->media_type == IFT_CARP))
continue;
-
+
log_debug("orig_rtr_lsa: stub net, "
"interface %s", iface->name);