summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-02-27 22:18:36 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-02-27 22:18:36 +0900
commitc847a87307ad360b526cd0de96e3dec2963b5076 (patch)
treea5f96ef63f215951bf99641bc931a96c5013cfc7 /server/peer.go
parentfb0a718339af7e2e18cf2c488959ae3e5dd5fc70 (diff)
server: implement softresetin and softreset
soft-reconfiguration inbound Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go23
1 files changed, 17 insertions, 6 deletions
diff --git a/server/peer.go b/server/peer.go
index 6a728768..ad8a72f7 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -223,12 +223,23 @@ func (peer *Peer) handleREST(restReq *api.RestRequest) {
case api.REQ_NEIGHBOR_RESET:
peer.fsm.idleHoldTime = peer.peerConfig.Timers.IdleHoldTImeAfterReset
peer.outgoing <- bgp.NewBGPNotificationMessage(bgp.BGP_ERROR_CEASE, bgp.BGP_ERROR_SUB_ADMINISTRATIVE_RESET, nil)
- case api.REQ_NEIGHBOR_SOFT_RESET:
- case api.REQ_NEIGHBOR_SOFT_RESET_IN:
- // check capability
- // drop allIn and other peers?
- // peer.adjRib.DropAllIn(peer.rf)
- peer.outgoing <- bgp.NewBGPRouteRefreshMessage(uint16(int(peer.rf)>>16), 0, uint8(int(peer.rf)&0xff))
+ case api.REQ_NEIGHBOR_SOFT_RESET, api.REQ_NEIGHBOR_SOFT_RESET_IN:
+ // soft-reconfiguration inbound
+ pathList := peer.adjRib.GetInPathList(peer.rf)
+ pm := &peerMsg{
+ msgType: PEER_MSG_PATH,
+ msgData: pathList,
+ }
+ for _, s := range peer.siblings {
+ if s.rf != peer.rf {
+ continue
+ }
+ s.peerMsgCh <- pm
+ }
+ if restReq.RequestType == api.REQ_NEIGHBOR_SOFT_RESET_IN {
+ break
+ }
+ fallthrough
case api.REQ_NEIGHBOR_SOFT_RESET_OUT:
pathList := peer.adjRib.GetOutPathList(peer.rf)
peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList))