summaryrefslogtreecommitdiffstats
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2008-10-26 22:48:02 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2008-10-26 22:48:02 +0100
commitba5ed6f3e4eb4b2899cdad08e2edb99063bfbcee (patch)
tree794368482cc653d27694ba541b9455c2863c2321 /proto/bgp/attrs.c
parent4847a894bf7d4852325c3f1ea4bb4890054a1f66 (diff)
downloadbird-ba5ed6f3e4eb4b2899cdad08e2edb99063bfbcee.tar
bird-ba5ed6f3e4eb4b2899cdad08e2edb99063bfbcee.zip
Implementation of an option for disabling AS4 support per BGP instance.
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r--proto/bgp/attrs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index a42a488..0fcd1ce 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -73,13 +73,13 @@ bgp_check_path(byte *a, int len, int bs, int errcode)
static int
bgp_check_as_path(struct bgp_proto *p, byte *a, int len)
{
- return bgp_check_path(a, len, (bgp_as4_support && p->as4_support) ? 4 : 2, 11);
+ return bgp_check_path(a, len, p->as4_session ? 4 : 2, 11);
}
static int
bgp_check_as4_path(struct bgp_proto *p, byte *a, int len)
{
- if (bgp_as4_support && (! p->as4_support))
+ if (bgp_as4_support && (! p->as4_session))
return bgp_check_path(a, len, 4, 9);
else
return 0;
@@ -106,7 +106,7 @@ bgp_check_next_hop(struct bgp_proto *p UNUSED, byte *a, int len)
static int
bgp_check_aggregator(struct bgp_proto *p, UNUSED byte *a, int len)
{
- int exp_len = (bgp_as4_support && p->as4_support) ? 8 : 6;
+ int exp_len = p->as4_session ? 8 : 6;
return (len == exp_len) ? 0 : 5;
}
@@ -344,7 +344,7 @@ bgp_encode_attrs(struct bgp_proto *p, byte *w, ea_list *attrs, int remains)
* we have to convert our 4B AS_PATH to 2B AS_PATH and send our AS_PATH
* as optional AS4_PATH attribute.
*/
- if ((code == BA_AS_PATH) && bgp_as4_support && (! p->as4_support))
+ if ((code == BA_AS_PATH) && bgp_as4_support && (! p->as4_session))
{
len = a->u.ptr->length;
@@ -384,7 +384,7 @@ bgp_encode_attrs(struct bgp_proto *p, byte *w, ea_list *attrs, int remains)
}
/* The same issue with AGGREGATOR attribute */
- if ((code == BA_AGGREGATOR) && bgp_as4_support && (! p->as4_support))
+ if ((code == BA_AGGREGATOR) && bgp_as4_support && (! p->as4_session))
{
int new_used;
@@ -1082,7 +1082,7 @@ bgp_remove_as4_attrs(struct bgp_proto *p, rta *a)
if ((fid == id1) || (fid == id2))
{
*el = (*el)->next;
- if (p->as4_support)
+ if (p->as4_session)
log(L_WARN "BGP: Unexpected AS4_* attributes received");
}
else
@@ -1246,7 +1246,7 @@ bgp_decode_attrs(struct bgp_conn *conn, byte *attr, unsigned int len, struct lin
/* When receiving attributes from non-AS4-aware BGP speaker,
* we have to reconstruct 4B AS_PATH and AGGREGATOR attributes
*/
- if (bgp_as4_support && (! bgp->as4_support))
+ if (bgp_as4_support && (! bgp->as4_session))
bgp_reconstruct_4b_atts(bgp, a, pool);
if (bgp_as4_support)