diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-11 14:52:24 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-11 14:52:24 +0900 |
commit | f2dd895b33969099cb548b3ee9cb30dafcd01433 (patch) | |
tree | 70023e59b8e3480531c28a9e43178550698c22c8 /server/fsm.go | |
parent | 9d5530e04b1b490794e4f014207057ea5279e73c (diff) |
packet: rename PacketParseError to MessageError
Handle not only parsing error.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/fsm.go')
-rw-r--r-- | server/fsm.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/server/fsm.go b/server/fsm.go index ee3d221e..c6e03e8f 100644 --- a/server/fsm.go +++ b/server/fsm.go @@ -347,12 +347,9 @@ 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 - } + e := err.(*bgp.MessageError) + m := bgp.NewBGPNotificationMessage(e.TypeCode, e.SubTypeCode, e.Data) + h.fsm.outgoing <- m return nil } } |