Finally make tap bridge work with VMs (bug 569)
This commit is contained in:
@@ -93,6 +93,12 @@ LoopbackNetDevice::GetChannel (void) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
LoopbackNetDevice::SetAddress (Address address)
|
||||
{
|
||||
m_address = Mac48Address::ConvertFrom (address);
|
||||
}
|
||||
|
||||
Address
|
||||
LoopbackNetDevice::GetAddress (void) const
|
||||
{
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
virtual void SetIfIndex(const uint32_t index);
|
||||
virtual uint32_t GetIfIndex(void) const;
|
||||
virtual Ptr<Channel> GetChannel (void) const;
|
||||
virtual void SetAddress (Address address);
|
||||
virtual Address GetAddress (void) const;
|
||||
virtual bool SetMtu (const uint16_t mtu);
|
||||
virtual uint16_t GetMtu (void) const;
|
||||
|
||||
@@ -300,7 +300,7 @@ Ptr<SimpleNetDevice>
|
||||
TcpSocketImplTest::AddSimpleNetDevice (Ptr<Node> node, const char* ipaddr, const char* netmask)
|
||||
{
|
||||
Ptr<SimpleNetDevice> dev = CreateObject<SimpleNetDevice> ();
|
||||
dev->SetAddress (Mac48Address::Allocate ());
|
||||
dev->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
|
||||
node->AddDevice (dev);
|
||||
Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
|
||||
uint32_t ndid = ipv4->AddInterface (dev);
|
||||
|
||||
@@ -134,7 +134,7 @@ UdpSocketImplTest::RunTests (void)
|
||||
Ptr<SimpleNetDevice> rxDev1, rxDev2;
|
||||
{ // first interface
|
||||
rxDev1 = CreateObject<SimpleNetDevice> ();
|
||||
rxDev1->SetAddress (Mac48Address::Allocate ());
|
||||
rxDev1->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
|
||||
rxNode->AddDevice (rxDev1);
|
||||
Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
|
||||
uint32_t netdev_idx = ipv4->AddInterface (rxDev1);
|
||||
@@ -145,7 +145,7 @@ UdpSocketImplTest::RunTests (void)
|
||||
|
||||
{ // second interface
|
||||
rxDev2 = CreateObject<SimpleNetDevice> ();
|
||||
rxDev2->SetAddress (Mac48Address::Allocate ());
|
||||
rxDev2->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
|
||||
rxNode->AddDevice (rxDev2);
|
||||
Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
|
||||
uint32_t netdev_idx = ipv4->AddInterface (rxDev2);
|
||||
@@ -160,7 +160,7 @@ UdpSocketImplTest::RunTests (void)
|
||||
Ptr<SimpleNetDevice> txDev1;
|
||||
{
|
||||
txDev1 = CreateObject<SimpleNetDevice> ();
|
||||
txDev1->SetAddress (Mac48Address::Allocate ());
|
||||
txDev1->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
|
||||
txNode->AddDevice (txDev1);
|
||||
Ptr<Ipv4> ipv4 = txNode->GetObject<Ipv4> ();
|
||||
uint32_t netdev_idx = ipv4->AddInterface (txDev1);
|
||||
@@ -171,7 +171,7 @@ UdpSocketImplTest::RunTests (void)
|
||||
Ptr<SimpleNetDevice> txDev2;
|
||||
{
|
||||
txDev2 = CreateObject<SimpleNetDevice> ();
|
||||
txDev2->SetAddress (Mac48Address::Allocate ());
|
||||
txDev2->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
|
||||
txNode->AddDevice (txDev2);
|
||||
Ptr<Ipv4> ipv4 = txNode->GetObject<Ipv4> ();
|
||||
uint32_t netdev_idx = ipv4->AddInterface (txDev2);
|
||||
|
||||
Reference in New Issue
Block a user