1
0

Additionally check for IP address validity.

This commit is contained in:
Alexander Andreev 2023-05-14 20:16:49 +04:00
parent e1871870ea
commit 0864526393
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -42,6 +42,8 @@ func main() {
ap, err := netip.ParseAddrPort(*listenAddress) ap, err := netip.ParseAddrPort(*listenAddress)
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)
} else if !ap.IsValid() {
log.Fatalln(*listenAddress, "is not valid")
} }
if ap.Addr().Is4() { if ap.Addr().Is4() {