From 27722dccc8614c464c25bbb960415ae2dd1aa482 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Wed, 10 Nov 2010 15:14:37 +0000 Subject: 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@ --- usr.sbin/bgpd/rde.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/bgpd/rde.c') 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 @@ -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"); -- cgit v1.2.3