mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-23 05:07:51 +01:00
Prevent link-local to non-link-local connections for multicast and broadcast.
This commit is contained in:
@@ -71,6 +71,11 @@ func (network *Network) BroadcastIPv4Listen() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For good network practice (and reducing amount of parallel connections), do not allow link-local to talk to non-link-local addresses.
|
||||||
|
if sender.(*net.UDPAddr).IP.IsLinkLocalUnicast() != network.address.IP.IsLinkLocalUnicast() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
//fmt.Printf("BroadcastIPv4Listen from %s at network %s\n", sender.String(), network.address.String())
|
//fmt.Printf("BroadcastIPv4Listen from %s at network %s\n", sender.String(), network.address.String())
|
||||||
|
|
||||||
if length < packetLengthMin {
|
if length < packetLengthMin {
|
||||||
|
|||||||
@@ -117,6 +117,11 @@ func (network *Network) MulticastIPv6Listen() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For good network practice (and reducing amount of parallel connections), do not allow link-local to talk to non-link-local addresses.
|
||||||
|
if sender.(*net.UDPAddr).IP.IsLinkLocalUnicast() != network.address.IP.IsLinkLocalUnicast() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
//fmt.Printf("MulticastIPv6Listen from %s at network %s\n", sender.String(), network.address.String())
|
//fmt.Printf("MulticastIPv6Listen from %s at network %s\n", sender.String(), network.address.String())
|
||||||
|
|
||||||
if length < packetLengthMin {
|
if length < packetLengthMin {
|
||||||
|
|||||||
Reference in New Issue
Block a user