summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-06 15:36:21 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-03-06 15:36:21 +0900
commita085ce2d338e9a79b98d0f9ea24c5b80bccdf0e1 (patch)
tree8bbb9d6b0d8866f20f411f60943344ab241ae202 /server/peer.go
parentea6446b4ef6e461837ed4f94216fe4fadf2964fa (diff)
server: check route refresh afi and safi
If it's not valid, log a warning and ignore. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/peer.go b/server/peer.go
index 91d7894b..8f456b83 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -132,6 +132,16 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) {
}
case bgp.BGP_MSG_ROUTE_REFRESH:
+ rr := m.Body.(*bgp.BGPRouteRefresh)
+ rf := bgp.AfiSafiToRouteFamily(rr.AFI, rr.SAFI)
+ if peer.rf != rf {
+ log.WithFields(log.Fields{
+ "Topic": "Peer",
+ "Key": peer.peerConfig.NeighborAddress,
+ "Data": rf,
+ }).Warn("Route family isn't supported")
+ return
+ }
if _, ok := peer.capMap[bgp.BGP_CAP_ROUTE_REFRESH]; ok {
pathList := peer.adjRib.GetOutPathList(peer.rf)
peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList))