internet: (fixes #2288) Ipv4 broadcast/multicast packets are sent on all the interfaces
This commit is contained in:
@@ -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
|
||||
------------
|
||||
|
||||
@@ -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::IpL4Protocol> 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::Ipv4RoutingProtocol> 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]
|
||||
|
||||
@@ -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::IpL4Protocol> 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::Ipv4RoutingProtocol> 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]
|
||||
|
||||
@@ -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<Ipv6StaticRouting> routing = 0;
|
||||
|
||||
@@ -714,14 +714,29 @@ Ipv4L3Protocol::Send (Ptr<Packet> packet,
|
||||
ifaceIter != m_interfaces.end (); ifaceIter++, ifaceIndex++)
|
||||
{
|
||||
Ptr<Ipv4Interface> outInterface = *ifaceIter;
|
||||
Ptr<Packet> 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<Packet> 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<Ipv4> (), ifaceIndex);
|
||||
outInterface->Send (packetCopy, destination);
|
||||
m_sendOutgoingTrace (ipHeader, packetCopy, ifaceIndex);
|
||||
packetCopy->AddHeader (ipHeader);
|
||||
m_txTrace (packetCopy, m_node->GetObject<Ipv4> (), ifaceIndex);
|
||||
outInterface->Send (packetCopy, destination);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user