summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/util.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2021-02-24 08:27:44 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2021-02-24 08:27:44 +0900
commit65d094d7f25e7304832b104f429449cbcd22770d (patch)
tree82d9c0aafdfed875b83dae561bfeb4254c747c0c /pkg/server/util.go
parentc1c2e05058ffce220edcb07f68bcd4208949b504 (diff)
server: fix AdministrativeCommunication message parser
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'pkg/server/util.go')
-rw-r--r--pkg/server/util.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/server/util.go b/pkg/server/util.go
index e4abbed0..474d495b 100644
--- a/pkg/server/util.go
+++ b/pkg/server/util.go
@@ -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:]
}