summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-12 12:58:21 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-12 12:58:21 +0900
commit78ec2585b7f8c1cb4f20d9c0283b3251b30669d3 (patch)
treeb1168e52313eea3de3af401e52f17e9ea95da210
parentc0e41ca009204ddaeda479084ead725d9f05aa7f (diff)
server: fix recvMessageloop() error handling
We could get errors from Read(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/fsm.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/fsm.go b/server/fsm.go
index c6e03e8f..06870f1b 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -347,9 +347,11 @@ func (h *FSMHandler) recvMessageloop() error {
for {
err := h.recvMessageWithError()
if err != nil {
- e := err.(*bgp.MessageError)
- m := bgp.NewBGPNotificationMessage(e.TypeCode, e.SubTypeCode, e.Data)
- h.fsm.outgoing <- m
+ e, y := err.(*bgp.MessageError)
+ if y {
+ m := bgp.NewBGPNotificationMessage(e.TypeCode, e.SubTypeCode, e.Data)
+ h.fsm.outgoing <- m
+ }
return nil
}
}