bug 2374: The TapFdNetDeviceHelper does not seem to work in ns-3.25. (fix by Tommaso Pecorella)
This commit is contained in:
@@ -64,7 +64,10 @@
|
||||
// # chown root.root build/src/fd-net-device/ns3-dev-tap-device-creator
|
||||
// # sudo chmod 4755 build/src/fd-net-device/ns3-dev-tap-device-creator
|
||||
//
|
||||
|
||||
// 4) The example can be executed as follows using waf:
|
||||
//
|
||||
// ./waf --run fd-tap-ping --command-template="%s --tapNetwork=<TAP-network-address> --tapMask=<TAP-network-mask>"
|
||||
//
|
||||
|
||||
#include "ns3/abort.h"
|
||||
#include "ns3/core-module.h"
|
||||
|
||||
@@ -64,9 +64,9 @@ TapFdNetDeviceHelper::TapFdNetDeviceHelper ()
|
||||
{
|
||||
m_deviceName = "";
|
||||
m_modePi = false;
|
||||
m_tapIp4 = "";
|
||||
m_tapMask4 = "";
|
||||
m_tapIp6 = "";
|
||||
m_tapIp4 = Ipv4Address::GetZero ();
|
||||
m_tapMask4 = Ipv4Mask::GetZero ();
|
||||
m_tapIp6 = Ipv6Address::GetZero ();
|
||||
m_tapPrefix6 = 64;
|
||||
m_tapMac = Mac48Address::Allocate ();
|
||||
}
|
||||
@@ -227,19 +227,19 @@ TapFdNetDeviceHelper::CreateFileDescriptor (void) const
|
||||
ossMac << "-m" << m_tapMac;
|
||||
|
||||
std::ostringstream ossIp4;
|
||||
if (m_tapIp4 != "")
|
||||
if (m_tapIp4 != Ipv4Address::GetZero ())
|
||||
{
|
||||
ossIp4 << "-i" << m_tapIp4;
|
||||
}
|
||||
|
||||
std::ostringstream ossIp6;
|
||||
if (m_tapIp6 != "")
|
||||
if (m_tapIp6 != Ipv6Address::GetZero ())
|
||||
{
|
||||
ossIp6 << "-I" << m_tapIp6;
|
||||
}
|
||||
|
||||
std::ostringstream ossNetmask4;
|
||||
if (m_tapMask4 != "" )
|
||||
if (m_tapMask4 != Ipv4Mask::GetZero () )
|
||||
{
|
||||
ossNetmask4 << "-n" << m_tapMask4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user