Fix potential ByteBuf leaks in bgp-l3vpn 57/96957/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 20 Jul 2021 15:35:32 +0000 (17:35 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 20 Jul 2021 17:18:26 +0000 (19:18 +0200)
commita54bf7f59a51125c075c4327e64908e6d10268c6
tree74b12042b56dc60cbbac611cb0bd3d5b1ba962b0
parent96f14238d36a221ae1f1038bbe9389b5466a49e6
Fix potential ByteBuf leaks in bgp-l3vpn

We are using ByteBuf.readBytes() to skip over some content and also
to frame it for parsing. Use ByteBuf.skipBytes() in the case of former
and ByteBuf.readSlice() in case of latter. This speeds things up and
plugs a potential refcount problem.

JIRA: BGPCEP-973
Change-Id: Ib9bf406a5e9de9b5e122c3fb3323a4b772a1a798
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit fed701f05399b8b7c9bd4014f97d2c8a75cfc9ef)
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/unicast/AbstractVpnNextHopParserSerializer.java