summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-03-18 19:41:42 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-03-18 19:41:42 +0000
commit22585be56620390cf56bc0b4e0afb83c85699166 (patch)
tree9dbcd9661824da793d0e3a4f63611016e08a29c2 /usr.sbin/bgpd
parentec5c1b1b77e79719850becc98cfb943733fd785f (diff)
Introduce local_as in the peer config. This allows per peer local AS and
simplifies some code because it is possible to get the local AS from the peer struct. Local AS needs more patching to work correctly though. OK henning@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/bgpd.h4
-rw-r--r--usr.sbin/bgpd/parse.y6
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 83761527054..d4abf4b1e3c 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.225 2009/03/13 06:25:04 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.226 2009/03/18 19:41:41 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -241,6 +241,7 @@ struct peer_config {
u_int32_t id;
u_int32_t groupid;
u_int32_t remote_as;
+ u_int32_t local_as;
u_int32_t max_prefix;
enum announce_type announce_type;
enum enforce_as enforce_as;
@@ -248,6 +249,7 @@ struct peer_config {
u_int16_t max_prefix_restart;
u_int16_t holdtime;
u_int16_t min_holdtime;
+ u_int16_t local_short_as;
u_int8_t template;
u_int8_t remote_masklen;
u_int8_t cloned;
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index ad30192cb36..ebebd8613df 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.219 2009/02/16 18:08:32 sthen Exp $ */
+/* $OpenBSD: parse.y,v 1.220 2009/03/18 19:41:41 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2454,6 +2454,8 @@ alloc_peer(void)
p->conf.capabilities.refresh = 1;
p->conf.capabilities.restart = 0;
p->conf.capabilities.as4byte = 0;
+ p->conf.local_as = conf->as;
+ p->conf.local_short_as = conf->short_as;
p->conf.softreconfig_in = 1;
p->conf.softreconfig_out = 1;
@@ -2476,6 +2478,8 @@ new_peer(void)
sizeof(p->conf.descr)) >= sizeof(p->conf.descr))
fatalx("new_peer descr strlcpy");
p->conf.groupid = curgroup->conf.id;
+ p->conf.local_as = curgroup->conf.local_as;
+ p->conf.local_short_as = curgroup->conf.local_short_as;
}
p->next = NULL;