Bugzilla – Bug 1285
IPv6 Localhost is marked as GLOBAL instead of HOST
Last modified: 2011-10-23 13:33:43 UTC
In ipv6-interface-address.cc, in the function: void Ipv6InterfaceAddress::SetAddress (Ipv6Address address) there is an if( address is localhost) {} if( address is link-local) {} else {} The end result is that the host address is first marked as HOST, then as GLOBAL (right, it isn't a LINKLOCAL, so it's GLOBAL). Quite wrong. The obvious solution is to change the if as follows: void Ipv6InterfaceAddress::SetAddress (Ipv6Address address) { NS_LOG_FUNCTION (this << address); m_address = address; if (address.IsLocalhost ()) { m_scope = HOST; /* localhost address is always /128 prefix */ m_prefix = Ipv6Prefix (128); } else if (address.IsLinkLocal ()) { m_scope = LINKLOCAL; /* link-local address is always /64 prefix */ m_prefix = Ipv6Prefix (64); } else { m_scope = GLOBAL; } } as is to change the second "if" in an "else if" Trivial, no need to submit a patch.
Fixed in changeset 487ec929a633