aboutsummaryrefslogtreecommitdiff
path: root/process.go
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-06-08 12:48:01 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-06-08 12:48:01 +0200
commit7285a5c0d3f9bfd7e545e2c198216ca19032d84d (patch)
tree018c965ee72102f7865ecd560bf1819bd286b91c /process.go
parent47cc8437f1cd6ec6c92d801483c6ab787a196613 (diff)
check both bounds of protocol version range
Diffstat (limited to 'process.go')
-rw-r--r--process.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/process.go b/process.go
index ed8004d..4d5a0e0 100644
--- a/process.go
+++ b/process.go
@@ -46,8 +46,11 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
return
}
- if cmd.MaxProtoVer < protoVer {
- cc.Log("<-", "invalid protoVer", cmd.MaxProtoVer)
+ if cmd.MaxProtoVer < protoVer || cmd.MinProtoVer > protoVer {
+ min := cmd.MinProtoVer
+ max := cmd.MaxProtoVer
+
+ cc.Log("<-", "unsupported protoVer range min", min, "max", max, "expect", protoVer)
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.UnsupportedVer})
select {