summaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-01-09 18:24:07 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-11 14:18:01 +0900
commit9d5530e04b1b490794e4f014207057ea5279e73c (patch)
treee2794021f20a66c2fc44c75952bceaea445ffad1 /server
parent5445305188efb078a6d642690f68cb44ab25a291 (diff)
packet: add data length check and notification
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r--server/fsm.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/fsm.go b/server/fsm.go
index f3b6c3db..ee3d221e 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -347,6 +347,12 @@ func (h *FSMHandler) recvMessageloop() error {
for {
err := h.recvMessageWithError()
if err != nil {
+ switch e := err.(type) {
+ case *bgp.PacketParseError:
+ // enqueue notification message
+ n := bgp.NewBGPNotificationMessage(e.TypeCode, e.SubTypeCode, nil)
+ h.fsm.outgoing <- n
+ }
return nil
}
}