summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2009-03-26 13:59:31 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2009-03-26 13:59:31 +0000
commit8b2a227a5897891250857f9d7d2fdfd744d67f75 (patch)
tree1a776cb602aec916f29911570ca80659d2c0037c
parent5f475229f8e08e1366ab1625121e5c12876423a0 (diff)
argh, do not reuse the global trans_as flag to be applied to the peer
specific or we had to widen the peer specific flags without need. defien PERRFLAG_TRANS_AS instead and use that
-rw-r--r--usr.sbin/bgpd/bgpd.h4
-rw-r--r--usr.sbin/bgpd/parse.y10
-rw-r--r--usr.sbin/bgpd/printconf.c4
-rw-r--r--usr.sbin/bgpd/rde_update.c6
4 files changed, 13 insertions, 11 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 9e3aa49c8ad..92186d896c9 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.227 2009/03/22 22:34:59 henning Exp $ */
+/* $OpenBSD: bgpd.h,v 1.228 2009/03/26 13:59:30 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -266,6 +266,8 @@ struct peer_config {
u_int8_t pad[3];
};
+#define PEERFLAG_TRANS_AS 0x01
+
struct network_config {
struct bgpd_addr prefix;
struct filter_set_head attrset;
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 6caf37d248d..7be769f5a8e 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.221 2009/03/22 22:34:59 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.222 2009/03/26 13:59:30 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1060,9 +1060,9 @@ peeropts : REMOTEAS as4number {
}
| TRANSPARENT yesno {
if ($2 == 1)
- curpeer->conf.flags |= BGPD_FLAG_DECISION_TRANS_AS;
+ curpeer->conf.flags |= PEERFLAG_TRANS_AS;
else
- curpeer->conf.flags &= ~BGPD_FLAG_DECISION_TRANS_AS;
+ curpeer->conf.flags &= ~PEERFLAG_TRANS_AS;
}
;
@@ -2488,8 +2488,8 @@ new_peer(void)
p->conf.local_short_as = curgroup->conf.local_short_as;
}
p->next = NULL;
- p->conf.flags = (conf->flags & BGPD_FLAG_DECISION_TRANS_AS);
-
+ if (conf->flags & BGPD_FLAG_DECISION_TRANS_AS)
+ p->conf.flags |= PEERFLAG_TRANS_AS;
return (p);
}
diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c
index b444b69c736..1f311f5201b 100644
--- a/usr.sbin/bgpd/printconf.c
+++ b/usr.sbin/bgpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.66 2009/03/22 22:35:00 henning Exp $ */
+/* $OpenBSD: printconf.c,v 1.67 2009/03/26 13:59:30 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -317,7 +317,7 @@ print_peer(struct peer_config *p, struct bgpd_config *conf, const char *c)
printf("%s\tdemote %s\n", c, p->demote_group);
if (p->if_depend[0])
printf("%s\tdepend on \"%s\"\n", c, p->if_depend);
- if (p->flags & BGPD_FLAG_DECISION_TRANS_AS)
+ if (p->flags & PEERFLAG_TRANS_AS)
printf("%s\ttransparent-as yes\n", c);
if (p->auth.method == AUTH_MD5SIG)
diff --git a/usr.sbin/bgpd/rde_update.c b/usr.sbin/bgpd/rde_update.c
index bebfcff1a94..469f584e89e 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.66 2009/03/22 22:35:00 henning Exp $ */
+/* $OpenBSD: rde_update.c,v 1.67 2009/03/26 13:59:30 henning Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -629,7 +629,7 @@ up_generate_attr(struct rde_peer *peer, struct update_attr *upa,
/* aspath */
if (!peer->conf.ebgp ||
- peer->conf.flags & BGPD_FLAG_DECISION_TRANS_AS)
+ peer->conf.flags & PEERFLAG_TRANS_AS)
pdata = aspath_prepend(a->aspath, rde_local_as(), 0, &plen);
else
pdata = aspath_prepend(a->aspath, rde_local_as(), 1, &plen);
@@ -762,7 +762,7 @@ up_generate_attr(struct rde_peer *peer, struct update_attr *upa,
/* NEW to OLD conversion when going sending stuff to a 2byte AS peer */
if (neednewpath) {
if (!peer->conf.ebgp ||
- peer->conf.flags & BGPD_FLAG_DECISION_TRANS_AS)
+ peer->conf.flags & PEERFLAG_TRANS_AS)
pdata = aspath_prepend(a->aspath, rde_local_as(), 0,
&plen);
else