mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
server: fix AdministrativeCommunication message parser
Signed-off-by: FUJITA Tomonori <[email protected]>
This commit is contained in:
+2
-2
@@ -59,8 +59,8 @@ func decodeAdministrativeCommunication(data []byte) (string, []byte) {
|
||||
if communicationLen > bgp.BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX {
|
||||
communicationLen = bgp.BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX
|
||||
}
|
||||
if communicationLen > len(data)+1 {
|
||||
communicationLen = len(data) + 1
|
||||
if communicationLen > len(data)-1 {
|
||||
communicationLen = len(data) - 1
|
||||
}
|
||||
return string(data[1 : communicationLen+1]), data[communicationLen+1:]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user