summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-11-10 15:14:37 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-11-10 15:14:37 +0000
commit27722dccc8614c464c25bbb960415ae2dd1aa482 (patch)
treec132cf5cbe378069caff52b0876c836b3ad84774 /usr.sbin/bgpd/rde.c
parentebfaac69617548d3e4845c8b32ce70f01731065d (diff)
Make sure that the initial configuration of the child is zeroed out
by using calloc(). This fixes an issue where the RDE would start up as route-collector because uninitialized memory made the RDE switch to that mode. OK henning@, sthen@, phessler@
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r--usr.sbin/bgpd/rde.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index ef35bcadae4..7a4ae4503fe 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.299 2010/10/15 07:43:02 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.300 2010/11/10 15:14:36 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -227,7 +227,7 @@ rde_main(int pipe_m2r[2], int pipe_s2r[2], int pipe_m2s[2], int pipe_s2rctl[2],
if (rdomains_l == NULL)
fatal(NULL);
SIMPLEQ_INIT(rdomains_l);
- if ((conf = malloc(sizeof(struct bgpd_config))) == NULL)
+ if ((conf = calloc(1, sizeof(struct bgpd_config))) == NULL)
fatal(NULL);
log_info("route decision engine ready");