Additionally check for IP address validity.
This commit is contained in:
parent
e1871870ea
commit
0864526393
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user