diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-08-05 18:44:20 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-08-05 18:44:20 +0000 |
commit | 475388ebf609553cd9c9c2e5c86f22388f366dcd (patch) | |
tree | 8127764db95d65e5da4dcd61ac2f6643a839bc85 /usr.sbin/bgpd/rde.c | |
parent | a9afe3a1c53305a7d4f2e003ce8fc277c893e008 (diff) |
Cleanup aspath specific functions and api. Mainly switch to a refcnt based
allocation. This helps to save a bit of RAM. looks good henning@
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r-- | usr.sbin/bgpd/rde.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 6278cc4301b..97e2d2bdc30 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.134 2004/08/05 16:26:56 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.135 2004/08/05 18:44:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -172,6 +172,7 @@ rde_main(struct bgpd_config *config, struct network_head *net_l, pt_init(); path_init(pathhashsize); + aspath_init(pathhashsize); nexthop_init(nexthophashsize); peer_init(peerhashsize); rules_l = rules; @@ -644,9 +645,6 @@ rde_update_dispatch(struct imsg *imsg) /* aspath needs to be loop free nota bene this is not a hard error */ if (peer->conf.ebgp && !aspath_loopfree(attrs.aspath, conf->as)) { - char *s; - aspath_asprint(&s, attrs.aspath->data, attrs.aspath->hdr.len); - free(s); attr_free(&attrs); return (0); } @@ -1481,7 +1479,7 @@ network_add(struct network_config *nc, int flagstatic) bzero(&attrs, sizeof(attrs)); - attrs.aspath = aspath_create(NULL, 0); + attrs.aspath = aspath_get(NULL, 0); attrs.nexthop.s_addr = INADDR_ANY; /* med = 0 */ attrs.lpref = DEFAULT_LPREF; |