Cleanup - WIP

This commit is contained in:
jdl
2026-06-07 19:42:04 +02:00
parent b8344a20b9
commit e9dffee2de
11 changed files with 310 additions and 42 deletions

View File

@@ -69,11 +69,8 @@ func Peer_Sanitize(p *Peer) {
p.Addr6 = addr.AsSlice()
}
}
if p.Port4 == 0 {
p.Port4 = 456
}
if len(p.Addr6) != 0 && p.Port6 == 0 {
p.Port6 = 456
if p.Port == 0 {
p.Port = 51820
}
}
@@ -87,11 +84,8 @@ func Peer_Validate(p *Peer) error {
if _, ok := netip.AddrFromSlice(p.Addr6); !ok {
return ErrInvalidIP
}
if p.Port6 == 0 {
return ErrInvalidPort
}
}
if p.Port4 == 0 {
if p.Port == 0 {
return ErrInvalidPort
}