summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-11 14:52:24 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-11 14:52:24 +0900
commitf2dd895b33969099cb548b3ee9cb30dafcd01433 (patch)
tree70023e59b8e3480531c28a9e43178550698c22c8 /server/fsm.go
parent9d5530e04b1b490794e4f014207057ea5279e73c (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.go9
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
}
}