diff --git a/RELEASE_NOTES b/RELEASE_NOTES index c8e9521a8..12dcc6f97 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -99,6 +99,7 @@ Bugs fixed - Bug 2279 - Ipv[4,6]L3Protocol::GetInterfaceForDevice speedup. - Bug 2286 - Support for SLL header (de)serialization. - Bug 2287 - FlowMonitor is confused by IP over IP. +- Bug 2288 - Ipv4 broadcast and multicast packets are replicated on all the interfaces. Known issues ------------ diff --git a/src/internet/bindings/modulegen__gcc_ILP32.py b/src/internet/bindings/modulegen__gcc_ILP32.py index 9a659b984..83af50830 100644 --- a/src/internet/bindings/modulegen__gcc_ILP32.py +++ b/src/internet/bindings/modulegen__gcc_ILP32.py @@ -2418,6 +2418,11 @@ def register_Ns3Ipv4Address_methods(root_module, cls): 'ns3::Ipv4Address', [], is_static=True) + ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsAny() const [member function] + cls.add_method('IsAny', + 'bool', + [], + is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', @@ -2433,6 +2438,11 @@ def register_Ns3Ipv4Address_methods(root_module, cls): 'bool', [], is_const=True) + ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalhost() const [member function] + cls.add_method('IsLocalhost', + 'bool', + [], + is_const=True) ## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', @@ -12092,6 +12102,11 @@ def register_Ns3Ipv4_methods(root_module, cls): 'ns3::Ptr< ns3::IpL4Protocol >', [param('int', 'protocolNumber')], is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h (module 'internet'): ns3::Ptr ns3::Ipv4::GetProtocol(int protocolNumber, int32_t interfaceIndex) const [member function] + cls.add_method('GetProtocol', + 'ns3::Ptr< ns3::IpL4Protocol >', + [param('int', 'protocolNumber'), param('int32_t', 'interfaceIndex')], + is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ptr ns3::Ipv4::GetRoutingProtocol() const [member function] cls.add_method('GetRoutingProtocol', 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', @@ -12172,6 +12187,11 @@ def register_Ns3Ipv4_methods(root_module, cls): 'void', [param('uint32_t', 'interface')], is_pure_virtual=True, is_virtual=True) + ## ipv4.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4::SourceAddressSelection(uint32_t interface, ns3::Ipv4Address dest) [member function] + cls.add_method('SourceAddressSelection', + 'ns3::Ipv4Address', + [param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'dest')], + is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ipv4::IF_ANY [variable] cls.add_static_attribute('IF_ANY', 'uint32_t const', is_const=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::GetIpForward() const [member function] @@ -12529,6 +12549,11 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls): 'void', [param('uint32_t', 'i')], is_virtual=True) + ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4L3Protocol::SourceAddressSelection(uint32_t interface, ns3::Ipv4Address dest) [member function] + cls.add_method('SourceAddressSelection', + 'ns3::Ipv4Address', + [param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'dest')], + is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::DoDispose() [member function] diff --git a/src/internet/bindings/modulegen__gcc_LP64.py b/src/internet/bindings/modulegen__gcc_LP64.py index 9a659b984..83af50830 100644 --- a/src/internet/bindings/modulegen__gcc_LP64.py +++ b/src/internet/bindings/modulegen__gcc_LP64.py @@ -2418,6 +2418,11 @@ def register_Ns3Ipv4Address_methods(root_module, cls): 'ns3::Ipv4Address', [], is_static=True) + ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsAny() const [member function] + cls.add_method('IsAny', + 'bool', + [], + is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', @@ -2433,6 +2438,11 @@ def register_Ns3Ipv4Address_methods(root_module, cls): 'bool', [], is_const=True) + ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalhost() const [member function] + cls.add_method('IsLocalhost', + 'bool', + [], + is_const=True) ## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', @@ -12092,6 +12102,11 @@ def register_Ns3Ipv4_methods(root_module, cls): 'ns3::Ptr< ns3::IpL4Protocol >', [param('int', 'protocolNumber')], is_pure_virtual=True, is_const=True, is_virtual=True) + ## ipv4.h (module 'internet'): ns3::Ptr ns3::Ipv4::GetProtocol(int protocolNumber, int32_t interfaceIndex) const [member function] + cls.add_method('GetProtocol', + 'ns3::Ptr< ns3::IpL4Protocol >', + [param('int', 'protocolNumber'), param('int32_t', 'interfaceIndex')], + is_pure_virtual=True, is_const=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ptr ns3::Ipv4::GetRoutingProtocol() const [member function] cls.add_method('GetRoutingProtocol', 'ns3::Ptr< ns3::Ipv4RoutingProtocol >', @@ -12172,6 +12187,11 @@ def register_Ns3Ipv4_methods(root_module, cls): 'void', [param('uint32_t', 'interface')], is_pure_virtual=True, is_virtual=True) + ## ipv4.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4::SourceAddressSelection(uint32_t interface, ns3::Ipv4Address dest) [member function] + cls.add_method('SourceAddressSelection', + 'ns3::Ipv4Address', + [param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'dest')], + is_pure_virtual=True, is_virtual=True) ## ipv4.h (module 'internet'): ns3::Ipv4::IF_ANY [variable] cls.add_static_attribute('IF_ANY', 'uint32_t const', is_const=True) ## ipv4.h (module 'internet'): bool ns3::Ipv4::GetIpForward() const [member function] @@ -12529,6 +12549,11 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls): 'void', [param('uint32_t', 'i')], is_virtual=True) + ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4L3Protocol::SourceAddressSelection(uint32_t interface, ns3::Ipv4Address dest) [member function] + cls.add_method('SourceAddressSelection', + 'ns3::Ipv4Address', + [param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'dest')], + is_virtual=True) ## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol::PROT_NUMBER [variable] cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True) ## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::DoDispose() [member function] diff --git a/src/internet/helper/ipv6-interface-container.cc b/src/internet/helper/ipv6-interface-container.cc index 514f84a75..3c69c14e8 100644 --- a/src/internet/helper/ipv6-interface-container.cc +++ b/src/internet/helper/ipv6-interface-container.cc @@ -96,7 +96,6 @@ void Ipv6InterfaceContainer::SetDefaultRouteInAllNodes (uint32_t router) for (other = 0; other < m_interfaces.size (); other++) { - std::cout << "Checking " << other << " Vs " << router << std::endl; if (other != router) { Ptr routing = 0; diff --git a/src/internet/model/ipv4-l3-protocol.cc b/src/internet/model/ipv4-l3-protocol.cc index 956fb7007..837651503 100644 --- a/src/internet/model/ipv4-l3-protocol.cc +++ b/src/internet/model/ipv4-l3-protocol.cc @@ -714,14 +714,29 @@ Ipv4L3Protocol::Send (Ptr packet, ifaceIter != m_interfaces.end (); ifaceIter++, ifaceIndex++) { Ptr outInterface = *ifaceIter; - Ptr packetCopy = packet->Copy (); + bool sendIt = false; + if (source == Ipv4Address::GetAny ()) + { + sendIt = true; + } + for (uint32_t index = 0; index < outInterface->GetNAddresses (); index++) + { + if (outInterface->GetAddress (index).GetLocal () == source) + { + sendIt = true; + } + } + if (sendIt) + { + Ptr packetCopy = packet->Copy (); - NS_ASSERT (packetCopy->GetSize () <= outInterface->GetDevice ()->GetMtu ()); + NS_ASSERT (packetCopy->GetSize () <= outInterface->GetDevice ()->GetMtu ()); - m_sendOutgoingTrace (ipHeader, packetCopy, ifaceIndex); - packetCopy->AddHeader (ipHeader); - m_txTrace (packetCopy, m_node->GetObject (), ifaceIndex); - outInterface->Send (packetCopy, destination); + m_sendOutgoingTrace (ipHeader, packetCopy, ifaceIndex); + packetCopy->AddHeader (ipHeader); + m_txTrace (packetCopy, m_node->GetObject (), ifaceIndex); + outInterface->Send (packetCopy, destination); + } } return; }