Skip to content

Commit

Permalink
bgpd: Check if as_type is not specified when peer is a peer-group member
Browse files Browse the repository at this point in the history
Fixes this sequences:

```
neighbor pg4 peer-group
neighbor 127.0.0.4 peer-group pg4
neighbor 127.0.0.4 remote-as 65004

neighbor pg5 peer-group
neighbor 127.0.0.5 peer-group pg5
neighbor 127.0.0.5 remote-as internal
```

Fixes: 0dfe256 ("bgpd: Implement neighbor X remote-as auto")

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Dec 6, 2024
1 parent 9797f20 commit 2797506
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2158,8 +2158,7 @@ int peer_remote_as(struct bgp *bgp, union sockunion *su, const char *conf_if,
/* When this peer is a member of peer-group. */
if (peer->group) {
/* peer-group already has AS number/internal/external */
if (peer->group->conf->as
|| peer->group->conf->as_type) {
if (peer->group->conf->as || peer->group->conf->as_type != AS_UNSPECIFIED) {
/* Return peer group's AS number. */
*as = peer->group->conf->as;
return BGP_ERR_PEER_GROUP_MEMBER;
Expand Down

0 comments on commit 2797506

Please sign in to comment.