Audit fixes

This commit is contained in:
jdl
2026-06-16 08:10:37 +02:00
parent 2b8cc86077
commit a2fe8dc79d
2 changed files with 2 additions and 2 deletions

View File

@@ -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.

View File

@@ -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))
}