Cleanup - WIP
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user