IPv6 IsAll[Nodes,Routers]Multicast scope fixes

This commit is contained in:
Tommaso Pecorella
2015-11-21 18:08:59 +01:00
parent 509cd1b7df
commit 8523d63420
2 changed files with 12 additions and 4 deletions

View File

@@ -36,6 +36,9 @@ New user-visible features
use specialized L4 protocols according to the interface.
- (internet) Ipv6Address::IsAllHostsMulticast() is now deprecated. FF02::3 is not
in the official reserved IPv6 multicast address list.
- (internet) Ipv6Address::IsAll[Nodes,Routers]Multicast() now checks the address
scope beyond the simple link-local. Nodes are checked for Interface-Local, Link-Local
and Realm-Local, Routers for the above plus Site-Local.
Bugs fixed
----------

View File

@@ -671,15 +671,20 @@ bool Ipv6Address::IsSolicitedMulticast () const
bool Ipv6Address::IsAllNodesMulticast () const
{
NS_LOG_FUNCTION (this);
static Ipv6Address allnodes ("ff02::1");
return (*this == allnodes);
static Ipv6Address allNodesI ("ff01::1");
static Ipv6Address allNodesL ("ff02::1");
static Ipv6Address allNodesR ("ff03::1");
return (*this == allNodesI || *this == allNodesL || *this == allNodesR);
}
bool Ipv6Address::IsAllRoutersMulticast () const
{
NS_LOG_FUNCTION (this);
static Ipv6Address allrouters ("ff02::2");
return (*this == allrouters);
static Ipv6Address allroutersI ("ff01::2");
static Ipv6Address allroutersL ("ff02::2");
static Ipv6Address allroutersR ("ff03::2");
static Ipv6Address allroutersS ("ff05::2");
return (*this == allroutersI || *this == allroutersL || *this == allroutersR || *this == allroutersS);
}
bool Ipv6Address::IsAllHostsMulticast () const