diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-09 05:32:38 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-09 05:32:38 -0800 |
commit | efcbc131df3aaee82eecc659cdf3428b9f5fe81b (patch) | |
tree | c5782347cf2c2387d771b1bd7441e8ebf463dafc /server/fsm.go | |
parent | d621be037478fe1f92eafb03356339459bd84bd6 (diff) |
server: move peerInfo from peer to fsm
fsm needs it with the later commit.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/fsm.go')
-rw-r--r-- | server/fsm.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/fsm.go b/server/fsm.go index d20de598..2de4787e 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -20,6 +20,7 @@ import ( log "github.com/Sirupsen/logrus" "github.com/osrg/gobgp/config" "github.com/osrg/gobgp/packet" + "github.com/osrg/gobgp/table" "gopkg.in/tomb.v2" "io" "net" @@ -80,6 +81,7 @@ type FSM struct { h *FSMHandler rfMap map[bgp.RouteFamily]bool confedCheck bool + peerInfo *table.PeerInfo } func (fsm *FSM) bgpMessageStateUpdate(MessageType uint8, isIn bool) { @@ -147,6 +149,7 @@ func NewFSM(gConf *config.Global, pConf *config.Neighbor) *FSM { getActiveCh: make(chan struct{}), rfMap: make(map[bgp.RouteFamily]bool), confedCheck: !config.IsConfederationMember(gConf, pConf) && config.IsEBGPPeer(gConf, pConf), + peerInfo: table.NewPeerInfo(gConf, pConf), } fsm.t.Go(fsm.connectLoop) return fsm @@ -567,6 +570,7 @@ func (h *FSMHandler) opensent() bgp.FSMState { fsm.sendNotificatonFromErrorMsg(h.conn, err.(*bgp.MessageError)) return bgp.BGP_FSM_IDLE } + fsm.peerInfo.ID = body.ID _, fsm.rfMap = open2Cap(body, fsm.pConf) e := &fsmMsg{ |