summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-06-26 23:18:23 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-06-26 23:18:23 +0900
commitde58be441150daf8943a5a66ced6703b8201303e (patch)
tree9ac3d65049a648e17158bafa7956e047fa5fdad4 /server
parent38230504ac1fb85409d382556d3e16e08149e399 (diff)
support AGGREGATOR and AS4_AGGREGATOR conversion
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/fsm.go26
1 files changed, 16 insertions, 10 deletions
diff --git a/server/fsm.go b/server/fsm.go
index e0fb53c2..e80c6512 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -634,18 +634,23 @@ func (h *FSMHandler) recvMessageWithError() (*FsmMsg, error) {
} else {
// FIXME: we should use the original message for bmp/mrt
table.UpdatePathAttrs4ByteAs(body)
- fmsg.PathList = table.ProcessMessage(m, h.fsm.peerInfo, fmsg.timestamp)
- id := h.fsm.pConf.Config.NeighborAddress
- policyMutex.RLock()
- for _, path := range fmsg.PathList {
- if path.IsEOR() {
- continue
- }
- if h.fsm.policy.ApplyPolicy(id, table.POLICY_DIRECTION_IN, path, nil) == nil {
- path.Filter(id, table.POLICY_DIRECTION_IN)
+ err := table.UpdatePathAggregator4ByteAs(body)
+ if err == nil {
+ fmsg.PathList = table.ProcessMessage(m, h.fsm.peerInfo, fmsg.timestamp)
+ id := h.fsm.pConf.Config.NeighborAddress
+ policyMutex.RLock()
+ for _, path := range fmsg.PathList {
+ if path.IsEOR() {
+ continue
+ }
+ if h.fsm.policy.ApplyPolicy(id, table.POLICY_DIRECTION_IN, path, nil) == nil {
+ path.Filter(id, table.POLICY_DIRECTION_IN)
+ }
}
+ policyMutex.RUnlock()
+ } else {
+ fmsg.MsgData = err
}
- policyMutex.RUnlock()
}
fmsg.payload = make([]byte, len(headerBuf)+len(bodyBuf))
copy(fmsg.payload, headerBuf)
@@ -1009,6 +1014,7 @@ func (h *FSMHandler) sendMessageloop() error {
"Data": m,
}).Debug("update for 2byte AS peer")
table.UpdatePathAttrs2ByteAs(m.Body.(*bgp.BGPUpdate))
+ table.UpdatePathAggregator2ByteAs(m.Body.(*bgp.BGPUpdate))
}
b, err := m.Serialize()
if err != nil {