From 3ba3b1459edd7a3072387f8c7fa14dddb1a8fb87 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Fri, 29 May 2020 14:21:16 +0000 Subject: [PATCH] internet: fix copy-paste error --- src/internet/model/ipv6-l3-protocol.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/internet/model/ipv6-l3-protocol.cc b/src/internet/model/ipv6-l3-protocol.cc index 10b66a704..a0f28a860 100644 --- a/src/internet/model/ipv6-l3-protocol.cc +++ b/src/internet/model/ipv6-l3-protocol.cc @@ -350,12 +350,10 @@ void Ipv6L3Protocol::RemoveAutoconfiguredAddress (uint32_t interface, Ipv6Addres NS_LOG_FUNCTION (this << interface << network << mask); Ptr iface = GetInterface (interface); Address addr = iface->GetDevice ()->GetAddress (); - uint32_t max = iface->GetNAddresses (); - uint32_t i = 0; Ipv6Address addressToFind = Ipv6Address::MakeAutoconfiguredAddress (addr, network); - for (i = 0; i < max; i++) + for (uint32_t i = 0; i < iface->GetNAddresses (); i++) { if (iface->GetAddress (i).GetAddress () == addressToFind) { @@ -363,16 +361,7 @@ void Ipv6L3Protocol::RemoveAutoconfiguredAddress (uint32_t interface, Ipv6Addres break; } } - - for (i = 0; i < max; i++) - { - if (iface->GetAddress (i).GetAddress () == addressToFind) - { - RemoveAddress (interface, i); - break; - } - } - + /* remove from list of autoconfigured address */ for (Ipv6AutoconfiguredPrefixListI it = m_prefixes.begin (); it != m_prefixes.end (); ++it) {