diff options
Diffstat (limited to 'server/server.go')
-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{ |