summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2014-04-19 15:43:18 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2014-04-19 15:43:18 +0000
commit68a2d4459b5a05aef1ff7e402fa24f3f6222aa18 (patch)
tree920832e4c4f965a934f49d47455348a4298938de /usr.sbin
parentd928d75807fdf70a8a940e8d2891386e6c2bac9b (diff)
Try to be clear why struct mrt_config nodes are allocated and
assigned to struct mrt pointers. I may need to rethink this later but lets hope this does not confuse more people and analyzers.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/mrt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/mrt.c b/usr.sbin/bgpd/mrt.c
index 95026a0c2c1..f48d7f4e01d 100644
--- a/usr.sbin/bgpd/mrt.c
+++ b/usr.sbin/bgpd/mrt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mrt.c,v 1.76 2013/11/13 20:41:01 benno Exp $ */
+/* $OpenBSD: mrt.c,v 1.77 2014/04/19 15:43:17 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -986,10 +986,12 @@ mrt_mergeconfig(struct mrt_head *xconf, struct mrt_head *nconf)
{
struct mrt *m, *xm;
+ /* both lists here are actually struct mrt_conifg nodes */
LIST_FOREACH(m, nconf, entry) {
if ((xm = mrt_get(xconf, m)) == NULL) {
/* NEW */
- if ((xm = calloc(1, sizeof(struct mrt_config))) == NULL)
+ if ((xm = (struct mrt *)calloc(1,
+ sizeof(struct mrt_config))) == NULL)
fatal("mrt_mergeconfig");
memcpy(xm, m, sizeof(struct mrt_config));
xm->state = MRT_STATE_OPEN;