summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJakub Chábek <jakub.chabek@cdn77.com>2021-09-09 18:08:07 +0200
committerJakub Chábek <jakub.chabek@cdn77.com>2021-09-09 18:08:07 +0200
commitb773e7f92464850af7f8ee505a2af3e5e4831e7a (patch)
tree134641f25c987947f3b457912d9cd03d48c54fcd
parentb931ccd0566e2852a0bf1c25b77488319d1882d0 (diff)
Pass BGPUpdate message even on error
-rw-r--r--pkg/packet/bmp/bmp.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/pkg/packet/bmp/bmp.go b/pkg/packet/bmp/bmp.go
index a704b907..8f2418c1 100644
--- a/pkg/packet/bmp/bmp.go
+++ b/pkg/packet/bmp/bmp.go
@@ -164,12 +164,11 @@ func NewBMPRouteMonitoring(p BMPPeerHeader, update *bgp.BGPMessage) *BMPMessage
}
func (body *BMPRouteMonitoring) ParseBody(msg *BMPMessage, data []byte) error {
- update, err := bgp.ParseBGPMessage(data)
- if err != nil {
- return err
- }
- body.BGPUpdate = update
- return nil
+ var err error
+
+ body.BGPUpdate, err = bgp.ParseBGPMessage(data)
+
+ return err
}
func (body *BMPRouteMonitoring) Serialize() ([]byte, error) {
@@ -1065,8 +1064,13 @@ func ParseBMPMessage(data []byte) (msg *BMPMessage, err error) {
err = msg.Body.ParseBody(msg, data)
if err != nil {
+ if msg.Header.Type == BMP_MSG_ROUTE_MONITORING {
+ return msg, err
+ }
+
return nil, err
}
+
return msg, nil
}