summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-05 13:32:58 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-10 00:04:48 +0900
commit7cec3f5e8984890b9cccc4a9911f821b891b9dfe (patch)
treee357a1c47b68e6b168cf6fcf2b0925c99935b15b /server/fsm.go
parent310be31d8832ec630ca87f448ad22e192c9c4e26 (diff)
fsm: delegate 2byte as handling to fsm send goroutine
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/fsm.go')
-rw-r--r--server/fsm.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/fsm.go b/server/fsm.go
index b5530f52..68e27074 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -992,6 +992,15 @@ func (h *FSMHandler) sendMessageloop() error {
fsm := h.fsm
ticker := keepaliveTicker(fsm)
send := func(m *bgp.BGPMessage) error {
+ if _, y := fsm.capMap[bgp.BGP_CAP_FOUR_OCTET_AS_NUMBER]; !y && m.Header.Type == bgp.BGP_MSG_UPDATE {
+ log.WithFields(log.Fields{
+ "Topic": "Peer",
+ "Key": fsm.pConf.Config.NeighborAddress,
+ "State": fsm.state,
+ "Data": m,
+ }).Debug("update for 2byte AS peer")
+ table.UpdatePathAttrs2ByteAs(m.Body.(*bgp.BGPUpdate))
+ }
b, err := m.Serialize()
if err != nil {
log.WithFields(log.Fields{