feature: ipv4 broadcast support and bugfix for reset connection reset of IPv4+IPv6 stacks (#139)

* feature: ipv4 broadcast support

* stackip4 method receiver varname
This commit is contained in:
Pat Whittingslow
2026-06-24 16:54:41 -03:00
committed by GitHub
parent ef279863a9
commit a42f0b404c
4 changed files with 51 additions and 25 deletions
+11
View File
@@ -18,6 +18,17 @@ func IsMulticast(addr [4]byte) bool {
return addr[0]&0xf0 == 0xe0
}
// IsBroadcast reports whether addr is the limited broadcast address
// 255.255.255.255 used to address all hosts on the local network segment
// as defined in [RFC919]. It does not detect directed (subnet) broadcast
// addresses, which depend on the network mask and cannot be determined from
// the address alone.
//
// [RFC919]: https://datatracker.ietf.org/doc/html/rfc919
func IsBroadcast(addr [4]byte) bool {
return addr == [4]byte{255, 255, 255, 255}
}
// IsLinkLocal reports whether addr is within the IPv4 link-local prefix
// 169.254.0.0/16 reserved for dynamic link-local configuration as defined in [RFC3927].
//