diff --git a/RELEASE_NOTES b/RELEASE_NOTES index d322cb10d..38d6edc4b 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -32,6 +32,7 @@ Bugs fixed - Bug 1669 - ns-3 should support binding two and three (possibly more) arguments - Bug 1689 - IPv6 shouldn't add a default gateway without checking the Router lifetime - Bug 1700 - Ipv6RawSocket does not honor the bound address when sending packets +- Bug 1701 - Ipv6StaticRouting: the source address should match the destination scope Known issues ------------ diff --git a/src/internet/model/ipv6-static-routing.cc b/src/internet/model/ipv6-static-routing.cc index 7da19c8da..2eb41f5a9 100644 --- a/src/internet/model/ipv6-static-routing.cc +++ b/src/internet/model/ipv6-static-routing.cc @@ -302,7 +302,7 @@ Ptr Ipv6StaticRouting::LookupStatic (Ipv6Address dst, Ptr } else if (route->GetDest ().IsAny ()) /* default route */ { - rtentry->SetSource (SourceAddressSelection (interfaceIdx, route->GetPrefixToUse ().IsAny () ? route->GetGateway () : route->GetPrefixToUse ())); + rtentry->SetSource (SourceAddressSelection (interfaceIdx, route->GetPrefixToUse ().IsAny () ? dst : route->GetPrefixToUse ())); } else { @@ -761,13 +761,14 @@ Ipv6Address Ipv6StaticRouting::SourceAddressSelection (uint32_t interface, Ipv6A return ret; } - /* useally IPv6 interfaces have one link-local address and one global address */ + /* usually IPv6 interfaces have one link-local address and one global address */ for (uint32_t i = 1; i < m_ipv6->GetNAddresses (interface); i++) { Ipv6InterfaceAddress test = m_ipv6->GetAddress (interface, i); + Ipv6InterfaceAddress dst(dest); - if (test.GetAddress ().CombinePrefix (test.GetPrefix ()) == dest.CombinePrefix (test.GetPrefix ())) + if (test.GetScope() == dst.GetScope()) { return test.GetAddress (); }