summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-12-10 22:12:52 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-12-15 12:09:43 +0900
commit75f495731bd16d4c517622c57da67922bb23891e (patch)
treea5342c442f28c9074392fd53ef0ef711609e7c54
parentad3850170cb928981dd4136b242cd4a354870756 (diff)
server: add error handling of invalid router-id
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--server/server.go4
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{