Skip to content
Snippets Groups Projects
Commit 8424ff0e authored by Daniel Czerwonk's avatar Daniel Czerwonk
Browse files

added test for existing boundary check

parent 26e6fc7e
No related branches found
No related tags found
No related merge requests found
...@@ -968,6 +968,17 @@ func TestDecodeMultiProtocolReachNLRI(t *testing.T) { ...@@ -968,6 +968,17 @@ func TestDecodeMultiProtocolReachNLRI(t *testing.T) {
}, },
}, },
}, },
{
name: "MP_REACH_NLRI with invalid prefixes",
input: []byte{
0x00, 0x02, // AFI
0x01, // SAFI
0x10, 0x20, 0x01, 0x06, 0x78, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // NextHop
0x00, // RESERVED
0x30, 0x26, 0x00, // Prefix
},
wantFail: true,
},
} }
t.Parallel() t.Parallel()
...@@ -1039,6 +1050,15 @@ func TestDecodeMultiProtocolUnreachNLRI(t *testing.T) { ...@@ -1039,6 +1050,15 @@ func TestDecodeMultiProtocolUnreachNLRI(t *testing.T) {
}, },
wantFail: true, wantFail: true,
}, },
{
name: "MP_REACH_NLRI with invalid prefixes",
input: []byte{
0x00, 0x02, // AFI
0x01, // SAFI
0x2c, 0x26, 0x20, 0x01, // Prefix
},
wantFail: true,
},
} }
t.Parallel() t.Parallel()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment