Skip to content

Commit

Permalink
Inherit software version capability from peer-group
Browse files Browse the repository at this point in the history
Fixes: 15f9d5c ("Add SoftwareVersion capability")
Fixes: #2767

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
  • Loading branch information
ton31337 committed May 21, 2024
1 parent 44e77cc commit 0dfa367
Show file tree
Hide file tree
Showing 7 changed files with 1,077 additions and 1,050 deletions.
2,091 changes: 1,051 additions & 1,040 deletions api/gobgp.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/gobgp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ message PeerGroupConf {
RemovePrivate remove_private = 7;
bool route_flap_damping = 8;
uint32 send_community = 9;
bool send_software_version = 10;
}

message PeerGroupState {
Expand Down
1 change: 1 addition & 0 deletions docs/sources/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
[peer-groups.config]
peer-group-name = "my-peer-group"
peer-as = 65000
#send-software-version = true
[[peer-groups.afi-safis]]
[peer-groups.afi-safis.config]
afi-safi-name = "ipv4-unicast"
Expand Down
12 changes: 9 additions & 3 deletions pkg/config/oc/bgp_configs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions pkg/config/oc/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,14 @@ func NewPeerGroupFromConfigStruct(pconf *PeerGroup) *api.PeerGroup {
return &api.PeerGroup{
ApplyPolicy: newApplyPolicyFromConfigStruct(&pconf.ApplyPolicy),
Conf: &api.PeerGroupConf{
PeerAsn: pconf.Config.PeerAs,
LocalAsn: pconf.Config.LocalAs,
Type: api.PeerType(pconf.Config.PeerType.ToInt()),
AuthPassword: pconf.Config.AuthPassword,
RouteFlapDamping: pconf.Config.RouteFlapDamping,
Description: pconf.Config.Description,
PeerGroupName: pconf.Config.PeerGroupName,
PeerAsn: pconf.Config.PeerAs,
LocalAsn: pconf.Config.LocalAs,
Type: api.PeerType(pconf.Config.PeerType.ToInt()),
AuthPassword: pconf.Config.AuthPassword,
RouteFlapDamping: pconf.Config.RouteFlapDamping,
Description: pconf.Config.Description,
PeerGroupName: pconf.Config.PeerGroupName,
SendSoftwareVersion: pconf.Config.SendSoftwareVersion,
},
Info: &api.PeerGroupState{
PeerAsn: s.PeerAs,
Expand Down
1 change: 1 addition & 0 deletions pkg/server/grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ func newPeerGroupFromAPIStruct(a *api.PeerGroup) (*oc.PeerGroup, error) {
pconf.Config.RouteFlapDamping = a.Conf.RouteFlapDamping
pconf.Config.Description = a.Conf.Description
pconf.Config.PeerGroupName = a.Conf.PeerGroupName
pconf.Config.SendSoftwareVersion = a.Conf.SendSoftwareVersion

switch a.Conf.RemovePrivate {
case api.RemovePrivate_REMOVE_ALL:
Expand Down
6 changes: 6 additions & 0 deletions tools/pyang_plugins/gobgp.yang
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,12 @@ module gobgp {
}
}

augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group/bgp:config" {
leaf send-software-version {
type boolean;
}
}

augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group" {
description "route server configuration for peer-group";
uses gobgp-route-server-config-set;
Expand Down

0 comments on commit 0dfa367

Please sign in to comment.