diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-12-10 22:12:52 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-12-15 12:09:43 +0900 |
commit | 75f495731bd16d4c517622c57da67922bb23891e (patch) | |
tree | a5342c442f28c9074392fd53ef0ef711609e7c54 /server | |
parent | ad3850170cb928981dd4136b242cd4a354870756 (diff) |
server: add error handling of invalid router-id
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go index c8267a44..42ab5c08 100644 --- a/server/server.go +++ b/server/server.go @@ -1327,6 +1327,10 @@ func (server *BgpServer) handleModGlobalConfig(grpcReq *GrpcRequest) error { return fmt.Errorf("gobgp is already started") } g := arg.Global + id := net.ParseIP(g.RouterId) + if id == nil { + return fmt.Errorf("invalid router-id format: %s", g.RouterId) + } c := config.Bgp{ Global: config.Global{ GlobalConfig: config.GlobalConfig{ |