From 7285a5c0d3f9bfd7e545e2c198216ca19032d84d Mon Sep 17 00:00:00 2001 From: HimbeerserverDE Date: Thu, 8 Jun 2023 12:48:01 +0200 Subject: check both bounds of protocol version range --- process.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'process.go') 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 { -- cgit v1.2.3