summaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/config
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg/config')
-rw-r--r--internal/pkg/config/bgp_configs.go11
-rw-r--r--internal/pkg/config/util.go7
2 files changed, 15 insertions, 3 deletions
diff --git a/internal/pkg/config/bgp_configs.go b/internal/pkg/config/bgp_configs.go
index 37fe1b39..0e375619 100644
--- a/internal/pkg/config/bgp_configs.go
+++ b/internal/pkg/config/bgp_configs.go
@@ -2548,6 +2548,10 @@ type TransportState struct {
// Remote port being used by the peer for the TCP session
// supporting the BGP session.
RemotePort uint16 `mapstructure:"remote-port" json:"remote-port,omitempty"`
+ // original -> bgp:bind-interface
+ // bgp:bind-interface's original type is union.
+ // Interface name for binding.
+ BindInterface string `mapstructure:"bind-interface" json:"bind-interface,omitempty"`
}
// struct for container bgp:config.
@@ -2580,6 +2584,10 @@ type TransportConfig struct {
// original -> gobgp:ttl
// TTL value for BGP packets.
Ttl uint8 `mapstructure:"ttl" json:"ttl,omitempty"`
+ // original -> bgp:bind-interface
+ // bgp:bind-interface's original type is union.
+ // Interface name for binding.
+ BindInterface string `mapstructure:"bind-interface" json:"bind-interface,omitempty"`
}
func (lhs *TransportConfig) Equal(rhs *TransportConfig) bool {
@@ -2604,6 +2612,9 @@ func (lhs *TransportConfig) Equal(rhs *TransportConfig) bool {
if lhs.Ttl != rhs.Ttl {
return false
}
+ if lhs.BindInterface != rhs.BindInterface {
+ return false
+ }
return true
}
diff --git a/internal/pkg/config/util.go b/internal/pkg/config/util.go
index 78a0e713..f85e9376 100644
--- a/internal/pkg/config/util.go
+++ b/internal/pkg/config/util.go
@@ -534,9 +534,10 @@ func NewPeerFromConfigStruct(pconf *Neighbor) *api.Peer {
LocalRestarting: pconf.GracefulRestart.State.LocalRestarting,
},
Transport: &api.Transport{
- RemotePort: uint32(pconf.Transport.Config.RemotePort),
- LocalAddress: localAddress,
- PassiveMode: pconf.Transport.Config.PassiveMode,
+ RemotePort: uint32(pconf.Transport.Config.RemotePort),
+ LocalAddress: localAddress,
+ PassiveMode: pconf.Transport.Config.PassiveMode,
+ BindInterface: pconf.Transport.Config.BindInterface,
},
AfiSafis: afiSafis,
}