diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-11-29 21:11:08 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-11-29 21:11:08 +0000 |
commit | 9ba6c7b553a591494444e098862acfc939c83b7b (patch) | |
tree | 3996b4db9a742db69cf84ac3e8e8d97e08d02169 /usr.sbin/bgpd/rde.c | |
parent | c7aa2cb78493cd2018b3edc94c4e3686f5f3c4bb (diff) |
Add a flags field to struct prefix which will be used shortly. Remove the peer
pointer so that the size does not grow. Adding 4 bytes to struct prefix would
result in 64MB more memory usage on one of my systems.
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r-- | usr.sbin/bgpd/rde.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 8fec1bf1304..8f981cb0102 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.179 2005/11/29 20:45:21 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.180 2005/11/29 21:11:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1553,7 +1553,7 @@ rde_dump_rib_as(struct prefix *p, pid_t pid) rib.flags = 0; if (p->prefix->active == p) rib.flags |= F_RIB_ACTIVE; - if (p->peer->conf.ebgp == 0) + if (p->aspath->peer->conf.ebgp == 0) rib.flags |= F_RIB_INTERNAL; if (p->aspath->flags & F_PREFIX_ANNOUNCED) rib.flags |= F_RIB_ANNOUNCE; @@ -1801,9 +1801,9 @@ rde_softreconfig_out(struct pt_entry *pt, void *ptr) nasp = path_copy(p->aspath); oa = rde_filter(rules_l, peer, oasp, &addr, pt->prefixlen, - p->peer, DIR_OUT); + p->aspath->peer, DIR_OUT); na = rde_filter(newrules, peer, nasp, &addr, pt->prefixlen, - p->peer, DIR_OUT); + p->aspath->peer, DIR_OUT); if (oa == ACTION_DENY && na == ACTION_DENY) /* nothing todo */ @@ -2301,7 +2301,7 @@ network_dump_upcall(struct pt_entry *pt, void *ptr) pt_getaddr(p->prefix, &addr); k.prefix.s_addr = addr.v4.s_addr; k.prefixlen = p->prefix->prefixlen; - if (p->peer == &peerself) + if (p->aspath->peer == &peerself) k.flags = F_KERNEL; if (imsg_compose(ibuf_se, IMSG_CTL_SHOW_NETWORK, 0, pid, -1, &k, sizeof(k)) == -1) @@ -2313,7 +2313,7 @@ network_dump_upcall(struct pt_entry *pt, void *ptr) pt_getaddr(p->prefix, &addr); memcpy(&k6.prefix, &addr.v6, sizeof(k6.prefix)); k6.prefixlen = p->prefix->prefixlen; - if (p->peer == &peerself) + if (p->aspath->peer == &peerself) k6.flags = F_KERNEL; if (imsg_compose(ibuf_se, IMSG_CTL_SHOW_NETWORK6, 0, pid, -1, &k6, sizeof(k6)) == -1) |