proxy: Check ephemeral port range ordering at flag parsing

This commit is contained in:
KokaKiwi 2022-10-14 21:40:07 +02:00
parent 10c8173120
commit 21d7449851
No known key found for this signature in database
GPG key ID: 09A5A2688F13FAC1

View file

@ -54,6 +54,9 @@ func main() {
if ephemeralMinPort == 0 || ephemeralMaxPort == 0 {
log.Fatal("Ephemeral port cannot be zero")
}
if ephemeralMinPort > ephemeralMaxPort {
log.Fatal("Invalid port range: min > max")
}
ephemeralPortsRange = []uint16{uint16(ephemeralMinPort), uint16(ephemeralMaxPort)}
} else {