Fix AS number comparison 65/79965/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 28 Jan 2019 18:18:42 +0000 (19:18 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 28 Jan 2019 22:10:42 +0000 (23:10 +0100)
commita5c966177232d617b6b05cf6bc9a3da44a65bf5c
tree9e5498c7cf91ec1fbeb91c79a5889c9134cf8978
parent5aad8274f1703f40bee6b9e2d07ff58aa4439fb9
Fix AS number comparison

Squashing AS number to an integer makes it possible for it to be
interpreted as a negative number -- which we then fail to squash
to AS_TRANS.

Fix this by forcing the comparison to happen on longs, which does
not suffer from this.

JIRA: BGPCEP-860
Change-Id: Iee10264aef22be70f34b2f122a063331bd0ec142
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 951271e2931d9f3a01fc6a9e3914573018dde2a1)
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AbstractBGPSessionNegotiator.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AbstractBGPSessionNegotiatorTest.java [new file with mode: 0644]