diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-08-05 20:56:13 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-08-05 20:56:13 +0000 |
commit | a325e1b07bf6f3f3555df360bcd18ec3428d0bf0 (patch) | |
tree | ed43c12e75133cc378971ea934fb12281413168b | |
parent | c9a88688b3627cc3685fd0a2f52852f00173a92c (diff) |
As usual cleanup on exit. OK henning@
-rw-r--r-- | usr.sbin/bgpd/rde.c | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.h | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde_attr.c | 16 |
3 files changed, 19 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 97e2d2bdc30..1743fb0de0f 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.135 2004/08/05 18:44:19 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.136 2004/08/05 20:56:11 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1599,7 +1599,9 @@ rde_shutdown(void) nexthop_shutdown(); path_shutdown(); + aspath_shutdown(); pt_shutdown(); peer_shutdown(); + free(mrt); } diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index e7829dba2dc..17007e6cc8d 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.49 2004/08/05 18:44:19 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.50 2004/08/05 20:56:12 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -256,6 +256,7 @@ int aspath_verify(void *, u_int16_t); #define AS_ERR_TYPE -2 #define AS_ERR_BAD -3 void aspath_init(u_int32_t); +void aspath_shutdown(void); struct aspath *aspath_get(void *, u_int16_t); void aspath_put(struct aspath *); u_char *aspath_dump(struct aspath *); diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 756d4649869..cbb7e925c35 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.40 2004/08/05 18:44:19 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.41 2004/08/05 20:56:12 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -720,7 +720,7 @@ aspath_init(u_int32_t hashsize) ; astable.hashtbl = calloc(hs, sizeof(struct aspath_list)); if (astable.hashtbl == NULL) - fatal("path_init"); + fatal("aspath_init"); for (i = 0; i < hs; i++) LIST_INIT(&astable.hashtbl[i]); @@ -728,6 +728,18 @@ aspath_init(u_int32_t hashsize) astable.hashmask = hs - 1; } +void +aspath_shutdown(void) +{ + u_int32_t i; + + for (i = 0; i <= astable.hashmask; i++) + if (!LIST_EMPTY(&astable.hashtbl[i])) + log_warnx("path_free: free non-free table"); + + free(astable.hashtbl); +} + struct aspath * aspath_get(void *data, u_int16_t len) { |