summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-08-05 16:26:57 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-08-05 16:26:57 +0000
commit59613300d9ce679fac0375f8df3b89426c8b486e (patch)
treedd83848acbc35af47c3fb920346f8d0aa6ac20b3 /usr.sbin/bgpd
parent36c0a45ea83f8ca9b3eb87be11b9f95ef180143c (diff)
struct prefix has a pointer to the peer so use it everywhere directly instead
of the detour via aspath.
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/mrt.c4
-rw-r--r--usr.sbin/bgpd/rde.c14
-rw-r--r--usr.sbin/bgpd/rde_rib.c8
-rw-r--r--usr.sbin/bgpd/rde_update.c14
4 files changed, 20 insertions, 20 deletions
diff --git a/usr.sbin/bgpd/mrt.c b/usr.sbin/bgpd/mrt.c
index aabf9ba9e61..ddecc29a2ad 100644
--- a/usr.sbin/bgpd/mrt.c
+++ b/usr.sbin/bgpd/mrt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mrt.c,v 1.37 2004/08/03 14:00:15 claudio Exp $ */
+/* $OpenBSD: mrt.c,v 1.38 2004/08/05 16:26:56 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -297,7 +297,7 @@ mrt_dump_upcall(struct pt_entry *pt, void *ptr)
*/
LIST_FOREACH(p, &pt->prefix_h, prefix_l)
mrt_dump_entry(mrtbuf, p, sequencenum++,
- &p->aspath->peer->conf);
+ &p->peer->conf);
}
static int
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 978b9e3fa8d..6278cc4301b 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.133 2004/08/05 15:58:21 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.134 2004/08/05 16:26:56 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -971,12 +971,12 @@ rde_dump_rib_as(struct prefix *p, pid_t pid)
rib.prefixlen = p->prefix->prefixlen;
rib.origin = p->aspath->flags.origin;
rib.flags = 0;
- if (p->aspath->nexthop->state == NEXTHOP_REACH)
- rib.flags |= F_RIB_ELIGIBLE;
if (p->prefix->active == p)
rib.flags |= F_RIB_ACTIVE;
- if (p->aspath->peer->conf.ebgp == 0)
+ if (p->peer->conf.ebgp == 0)
rib.flags |= F_RIB_INTERNAL;
+ if (p->aspath->nexthop->state == NEXTHOP_REACH)
+ rib.flags |= F_RIB_ELIGIBLE;
if (p->aspath->nexthop->flags & NEXTHOP_ANNOUNCE)
rib.flags |= F_RIB_ANNOUNCE;
rib.aspath_len = aspath_length(p->aspath->flags.aspath);
@@ -1001,12 +1001,12 @@ rde_dump_rib_prefix(struct prefix *p, pid_t pid)
pt_getaddr(p->prefix, &prefix.prefix);
prefix.prefixlen = p->prefix->prefixlen;
prefix.flags = 0;
- if (p->aspath->nexthop->state == NEXTHOP_REACH)
- prefix.flags |= F_RIB_ELIGIBLE;
if (p->prefix->active == p)
prefix.flags |= F_RIB_ACTIVE;
- if (p->aspath->peer->conf.ebgp == 0)
+ if (p->peer->conf.ebgp == 0)
prefix.flags |= F_RIB_INTERNAL;
+ if (p->aspath->nexthop->state == NEXTHOP_REACH)
+ prefix.flags |= F_RIB_ELIGIBLE;
if (p->aspath->nexthop->flags & NEXTHOP_ANNOUNCE)
prefix.flags |= F_RIB_ANNOUNCE;
if (imsg_compose_pid(&ibuf_se, IMSG_CTL_SHOW_RIB_PREFIX, pid,
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c
index 70fa052937a..5e0c5d6390c 100644
--- a/usr.sbin/bgpd/rde_rib.c
+++ b/usr.sbin/bgpd/rde_rib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_rib.c,v 1.51 2004/08/05 15:58:21 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.52 2004/08/05 16:26:56 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -404,7 +404,7 @@ prefix_move(struct rde_aspath *asp, struct prefix *p)
struct rde_aspath *oasp;
RIB_STAT(prefix_move);
- ENSURE(asp->peer == p->aspath->peer);
+ ENSURE(asp->peer == p->peer);
/* create new prefix node */
np = prefix_alloc();
@@ -496,7 +496,7 @@ prefix_bypeer(struct pt_entry *pte, struct rde_peer *peer)
struct prefix *p;
LIST_FOREACH(p, &pte->prefix_h, prefix_l) {
- if (p->aspath->peer == peer)
+ if (p->peer == peer)
return p;
}
return NULL;
@@ -610,7 +610,7 @@ prefix_unlink(struct prefix *pref)
LIST_REMOVE(pref, path_l);
pref->aspath->prefix_cnt--;
- pref->aspath->peer->prefix_cnt--;
+ pref->peer->prefix_cnt--;
/* destroy all references to other objects */
pref->aspath = NULL;
diff --git a/usr.sbin/bgpd/rde_update.c b/usr.sbin/bgpd/rde_update.c
index e44648a443e..d26bd2e30cc 100644
--- a/usr.sbin/bgpd/rde_update.c
+++ b/usr.sbin/bgpd/rde_update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_update.c,v 1.24 2004/07/30 14:44:30 claudio Exp $ */
+/* $OpenBSD: rde_update.c,v 1.25 2004/08/05 16:26:56 claudio Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -240,7 +240,7 @@ up_generate_updates(struct rde_peer *peer,
/* new prefix got filtered and no old prefex avail */
return;
- if (peer == old->aspath->peer)
+ if (peer == old->peer)
/* Do not send routes back to sender */
return;
@@ -253,7 +253,7 @@ up_generate_updates(struct rde_peer *peer,
*/
return;
- if (old->aspath->peer->conf.ebgp == 0 && peer->conf.ebgp == 0) {
+ if (old->peer->conf.ebgp == 0 && peer->conf.ebgp == 0) {
/*
* route reflector redistribution rules:
* 1. if announce is set -> announce
@@ -262,7 +262,7 @@ up_generate_updates(struct rde_peer *peer,
* 4. old non-client, new client -> yes
* 5. old client, new client -> yes
*/
- if (old->aspath->peer->conf.reflector_client == 0 &&
+ if (old->peer->conf.reflector_client == 0 &&
peer->conf.reflector_client == 0 &&
(old->aspath->nexthop->flags &
NEXTHOP_ANNOUNCE) == 0)
@@ -332,7 +332,7 @@ up_generate_updates(struct rde_peer *peer,
if (up_add(peer, p, NULL) == -1)
log_warnx("queuing withdraw failed.");
} else {
- if (peer == new->aspath->peer) {
+ if (peer == new->peer) {
/* Do not send routes back to sender */
up_generate_updates(peer, NULL, old);
return;
@@ -349,7 +349,7 @@ up_generate_updates(struct rde_peer *peer,
return;
}
- if (new->aspath->peer->conf.ebgp == 0 && peer->conf.ebgp == 0) {
+ if (new->peer->conf.ebgp == 0 && peer->conf.ebgp == 0) {
/*
* route reflector redistribution rules:
* 1. if announce is set -> announce
@@ -358,7 +358,7 @@ up_generate_updates(struct rde_peer *peer,
* 4. old non-client, new client -> yes
* 5. old client, new client -> yes
*/
- if (new->aspath->peer->conf.reflector_client == 0 &&
+ if (new->peer->conf.reflector_client == 0 &&
peer->conf.reflector_client == 0 &&
(new->aspath->nexthop->flags &
NEXTHOP_ANNOUNCE) == 0) {