mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
check mtu setting
This commit is contained in:
parent
16f5f81fe9
commit
a0d08e4961
@ -4,6 +4,9 @@ package kcp
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"github.com/v2ray/v2ray-core/common/log"
|
||||
)
|
||||
|
||||
func (this *Config) UnmarshalJSON(data []byte) error {
|
||||
@ -15,6 +18,11 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
||||
return err
|
||||
}
|
||||
if jsonConfig.Mtu != nil {
|
||||
mtu := *jsonConfig.Mtu
|
||||
if mtu < 576 || mtu > 1460 {
|
||||
log.Error("KCP|Config: Invalid MTU size: ", mtu)
|
||||
return errors.New("Invalid configuration")
|
||||
}
|
||||
this.Mtu = *jsonConfig.Mtu
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user