summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/peer.go11
-rw-r--r--server/server.go3
-rw-r--r--table/table_manager.go7
3 files changed, 5 insertions, 16 deletions
diff --git a/server/peer.go b/server/peer.go
index 4e079c13..d32eacb0 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -179,9 +179,6 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) {
msgData: pathList,
}
for _, s := range peer.siblings {
- if s.rf != peer.rf {
- continue
- }
s.peerMsgCh <- pm
}
}
@@ -240,9 +237,6 @@ func (peer *Peer) handleREST(restReq *api.RestRequest) {
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 {
@@ -334,7 +328,7 @@ func (peer *Peer) handleServerMsg(m *serverMsg) {
case SRV_MSG_PEER_ADDED:
d := m.msgData.(*serverMsgDataPeer)
peer.siblings[d.address.String()] = d
- pathList := peer.adjRib.GetInPathList(d.rf)
+ pathList := peer.adjRib.GetInPathList(peer.rf)
if len(pathList) == 0 {
return
}
@@ -343,9 +337,6 @@ func (peer *Peer) handleServerMsg(m *serverMsg) {
msgData: pathList,
}
for _, s := range peer.siblings {
- if s.rf != peer.rf {
- continue
- }
s.peerMsgCh <- pm
}
case SRV_MSG_PEER_DELETED:
diff --git a/server/server.go b/server/server.go
index 3d852cb8..f92a1294 100644
--- a/server/server.go
+++ b/server/server.go
@@ -21,7 +21,6 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/osrg/gobgp/api"
"github.com/osrg/gobgp/config"
- "github.com/osrg/gobgp/packet"
"net"
"os"
"strconv"
@@ -45,7 +44,6 @@ type serverMsg struct {
type serverMsgDataPeer struct {
peerMsgCh chan *peerMsg
address net.IP
- rf bgp.RouteFamily
}
type peerMapInfo struct {
@@ -162,7 +160,6 @@ func (server *BgpServer) Serve() {
d := &serverMsgDataPeer{
address: peer.NeighborAddress,
peerMsgCh: pch,
- rf: p.rf,
}
msg := &serverMsg{
msgType: SRV_MSG_PEER_ADDED,
diff --git a/table/table_manager.go b/table/table_manager.go
index e7815af6..59b0a275 100644
--- a/table/table_manager.go
+++ b/table/table_manager.go
@@ -249,9 +249,10 @@ func (manager *TableManager) ProcessPaths(pathList []Path) ([]Path, []Path, erro
destinationList := make([]Destination, 0)
for _, path := range pathList {
rf := path.GetRouteFamily()
- // push Path into table
- destination := insert(manager.Tables[rf], path)
- destinationList = append(destinationList, destination)
+ if _, ok := manager.Tables[rf]; ok {
+ destination := insert(manager.Tables[rf], path)
+ destinationList = append(destinationList, destination)
+ }
}
return manager.calculate(destinationList)
}