summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgpd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index cc160a52fe..db97810013 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1616,7 +1616,8 @@ peer_remote_as (struct bgp *bgp, union sockunion *su, const char *conf_if,
}
/* Existing peer's AS number change. */
- if ((peer->as != *as) || (peer->as_type != as_type))
+ if (((peer->as_type == AS_SPECIFIED) && peer->as != *as) ||
+ (peer->as_type != as_type))
peer_as_change (peer, *as, as_type);
}
else
@@ -2305,7 +2306,8 @@ peer_group_remote_as (struct bgp *bgp, const char *group_name,
for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
- if ((peer->as != *as) || (peer->as_type != as_type))
+ if (((peer->as_type == AS_SPECIFIED) && peer->as != *as) ||
+ (peer->as_type != as_type))
peer_as_change (peer, *as, as_type);
}