Audit fixes
This commit is contained in:
@@ -55,7 +55,7 @@ func Network_Validate(c *Network) error {
|
||||
}
|
||||
|
||||
func Peer_Sanitize(p *Peer) {
|
||||
p.Name = strings.TrimSpace(p.Name)
|
||||
p.Name = strings.TrimSpace(strings.ToLower(p.Name))
|
||||
if len(p.Addr4) != 0 {
|
||||
if addr, ok := netip.AddrFromSlice(p.Addr4); ok {
|
||||
// Unmap so an IPv4-mapped form is stored canonically as 4 bytes.
|
||||
|
||||
@@ -88,5 +88,5 @@ func multicastAddr(vpnIP netip.Addr) *net.UDPAddr {
|
||||
b := vpnIP.As4()
|
||||
return net.UDPAddrFromAddrPort(
|
||||
netip.AddrPortFrom(
|
||||
netip.AddrFrom4([4]byte{239, b[1], b[2], 0}), 4560))
|
||||
netip.AddrFrom4([4]byte{239, b[0], b[1], b[2]}), 4560))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user