diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-03-16 18:08:43 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-03-17 10:47:11 +0900 |
commit | a5cc2b139733f35aa9733b081e0c12e1bb3505d4 (patch) | |
tree | 11bdb7cb88f1f655bb19998aa71e929c331ae3e8 /server | |
parent | 74b6b11a029a585a6e22b8a4eb59c4d87504fa5e (diff) |
cli: enhance global command
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/server/server.go b/server/server.go index d5cc8882..846931c4 100644 --- a/server/server.go +++ b/server/server.go @@ -1697,11 +1697,7 @@ func (server *BgpServer) handleModConfig(grpcReq *GrpcRequest) error { if c.ListenConfig.Port > 0 { acceptCh := make(chan *net.TCPConn, 4096) - list := []string{"0.0.0.0", "::"} - if len(c.ListenConfig.LocalAddressList) > 0 { - list = c.ListenConfig.LocalAddressList - } - for _, addr := range list { + for _, addr := range c.ListenConfig.LocalAddressList { l, err := listenAndAccept(addr, uint32(c.ListenConfig.Port), acceptCh) if err != nil { return err @@ -1805,10 +1801,16 @@ func (server *BgpServer) handleGrpc(grpcReq *GrpcRequest) []*SenderMsg { switch grpcReq.RequestType { case REQ_GLOBAL_CONFIG: + g := server.bgpConfig.Global result := &GrpcResponse{ Data: &api.Global{ - As: server.bgpConfig.Global.Config.As, - RouterId: server.bgpConfig.Global.Config.RouterId, + As: g.Config.As, + RouterId: g.Config.RouterId, + ListenPort: g.ListenConfig.Port, + ListenAddresses: g.ListenConfig.LocalAddressList, + MplsLabelMin: g.MplsLabelRange.MinLabel, + MplsLabelMax: g.MplsLabelRange.MaxLabel, + Collector: g.Collector.Enabled, }, } grpcReq.ResponseCh <- result |