diff options
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go index d1b0b0ff..1ecbedf0 100644 --- a/server/server.go +++ b/server/server.go @@ -241,6 +241,14 @@ func (server *BgpServer) Serve() { "Topic": "Peer", }).Debugf("Accepted a new dynamic neighbor from:%s", remoteAddr) peer := newDynamicPeer(&server.bgpConfig.Global, remoteAddr, pg.Conf, server.globalRib, server.policy) + if peer == nil { + log.WithFields(log.Fields{ + "Topic": "Peer", + "Key": remoteAddr, + }).Infof("Can't create new Dynamic Peer") + conn.Close() + return + } server.policy.Reset(nil, map[string]config.ApplyPolicy{peer.ID(): peer.fsm.pConf.ApplyPolicy}) server.neighborMap[remoteAddr] = peer peer.startFSMHandler(server.fsmincomingCh, server.fsmStateCh) |