diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-08-01 03:42:02 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-08-01 03:42:02 +0900 |
commit | 0d53551b0a5f297a3fbf47cf7a79ae7c2993bd7e (patch) | |
tree | 744686852194966eeb1fc35d4463766c028e358a /server | |
parent | 55f473d7fe07a72dbddcc424d4d6bce76e609e1b (diff) |
server: UpdateNeighbor() needs address parameter checking
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/server.go b/server/server.go index 379623a3..9820f898 100644 --- a/server/server.go +++ b/server/server.go @@ -1793,7 +1793,11 @@ func (s *BgpServer) UpdateNeighbor(c *config.Neighbor) (policyUpdated bool, err }() addr := c.Config.NeighborAddress - peer := s.neighborMap[addr] + peer, ok := s.neighborMap[addr] + if !ok { + err = fmt.Errorf("Neighbor that has %v doesn't exist.", addr) + return + } if !peer.fsm.pConf.ApplyPolicy.Equal(&c.ApplyPolicy) { log.WithFields(log.Fields{ |