diff --git a/protocols/bmp/packet/initiation_message.go b/protocols/bmp/packet/initiation_message.go index 6d4ee7ecc707702bfa4277901cab76be56c826a8..6fbc3f30c2c0f09e178b981964661990425ca597 100644 --- a/protocols/bmp/packet/initiation_message.go +++ b/protocols/bmp/packet/initiation_message.go @@ -33,7 +33,6 @@ func decodeInitiationMessage(buf *bytes.Buffer, ch *CommonHeader) (Msg, error) { im.TLVs = append(im.TLVs, tlv) read += uint32(tlv.InformationLength) + MinInformationTLVLen - fmt.Printf("read: %d\n", read) } return im, nil diff --git a/protocols/bmp/packet/initiation_message_test.go b/protocols/bmp/packet/initiation_message_test.go index 4513a2bed89f4e7c448e4ef87b432e6a68b4c1c1..d5c3a129b7adc3a0ec46778d10f05da46b175ec9 100644 --- a/protocols/bmp/packet/initiation_message_test.go +++ b/protocols/bmp/packet/initiation_message_test.go @@ -41,6 +41,9 @@ func TestDecodeInitiationMessage(t *testing.T) { }, wantFail: false, expected: &InitiationMessage{ + CommonHeader: &CommonHeader{ + MsgLength: CommonHeaderLen + 17, + }, TLVs: []*InformationTLV{ { InformationType: 1, diff --git a/protocols/bmp/packet/termination_message_test.go b/protocols/bmp/packet/termination_message_test.go index 412704b8693e170d505bebfb42f786338bd5bb3d..9f33bbfe0a07ef2de80ed2ce850c3742ed613916 100644 --- a/protocols/bmp/packet/termination_message_test.go +++ b/protocols/bmp/packet/termination_message_test.go @@ -41,6 +41,9 @@ func TestDecodeTerminationMessage(t *testing.T) { }, wantFail: false, expected: &TerminationMessage{ + CommonHeader: &CommonHeader{ + MsgLength: CommonHeaderLen + 17, + }, TLVs: []*InformationTLV{ { InformationType: 1,