diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-12-01 22:20:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-12-19 20:11:56 +0900 |
commit | 598bba9fb2b761d1ad32776b0a61357500227de1 (patch) | |
tree | 02737038dc8c6b330cdf7690bc6cb3be2b3c8fe6 /pkg/server/server.go | |
parent | 831b33fdb75074f7fbc19c6a7b966e1633ad5200 (diff) |
server: use Dialer Control method instead of hack to modify connection before dialing
Use the feature of go 1.11 to remove the hack.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/server/server.go')
-rw-r--r-- | pkg/server/server.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go index 09ff114e..f7a09daf 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -1589,8 +1589,8 @@ func (s *BgpServer) AddBmp(ctx context.Context, r *api.AddBmpRequest) error { return fmt.Errorf("invalid bmp route monitoring policy: %v", r.Type) } return s.bmpManager.addServer(&config.BmpServerConfig{ - Address: r.Address, - Port: r.Port, + Address: r.Address, + Port: r.Port, RouteMonitoringPolicy: config.IntToBmpRouteMonitoringPolicyTypeMap[int(r.Type)], StatisticsTimeout: uint16(r.StatisticsTimeout), }) @@ -2520,7 +2520,7 @@ func (s *BgpServer) ListPeer(ctx context.Context, r *api.ListPeerRequest, fn fun p := config.NewPeerFromConfigStruct(s.toConfig(peer, getAdvertised)) for _, family := range peer.configuredRFlist() { for i, afisafi := range p.AfiSafis { - if afisafi.Config.Enabled != true { + if !afisafi.Config.Enabled { continue } afi, safi := bgp.RouteFamilyToAfiSafi(family) @@ -2530,7 +2530,7 @@ func (s *BgpServer) ListPeer(ctx context.Context, r *api.ListPeerRequest, fn fun received := uint32(peer.adjRibIn.Count(flist)) accepted := uint32(peer.adjRibIn.Accepted(flist)) advertised := uint32(0) - if getAdvertised == true { + if getAdvertised { pathList, _ := s.getBestFromLocal(peer, flist) advertised = uint32(len(pathList)) } |