diff options
author | 2010-11-10 15:14:36 +0000 | |
---|---|---|
committer | 2010-11-10 15:14:36 +0000 | |
commit | 42fb26f4e275e38af80d42fb73f6e01cbf9b21d6 (patch) | |
tree | 9590ca5dff292901ba84c61441eae0ae69d60851 | |
parent | Make -dvv flags produce debug traces of decoded BER messages on stderr. (diff) | |
download | wireguard-openbsd-42fb26f4e275e38af80d42fb73f6e01cbf9b21d6.tar.xz wireguard-openbsd-42fb26f4e275e38af80d42fb73f6e01cbf9b21d6.zip |
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@
-rw-r--r-- | usr.sbin/bgpd/rde.c | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.c | 4 |
2 files changed, 4 insertions, 4 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"); diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 7274c7de2e8..122fde40c77 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.312 2010/10/15 07:45:32 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.313 2010/11/10 15:14:36 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> @@ -247,7 +247,7 @@ session_main(int pipe_m2s[2], int pipe_s2r[2], int pipe_m2r[2], peer_cnt = 0; ctl_cnt = 0; - if ((conf = malloc(sizeof(struct bgpd_config))) == NULL) + if ((conf = calloc(1, sizeof(struct bgpd_config))) == NULL) fatal(NULL); if ((conf->listen_addrs = calloc(1, sizeof(struct listen_addrs))) == NULL) |