repair broken nsc workaround that was uncovered by the fix in changeset 62dee74123ca
--- a/src/internet/model/nsc-tcp-l4-protocol.cc Mon Mar 26 17:31:32 2012 +0100
+++ b/src/internet/model/nsc-tcp-l4-protocol.cc Tue Mar 27 12:05:02 2012 -0700
@@ -440,23 +440,17 @@
if (i == 1)
{
- // We need to come up with a default gateway here. Can't guarantee this to be
- // correct really...
-
- uint8_t addrBytes[4];
- addr.Serialize (addrBytes);
-
- // XXX: this is all a bit of a horrible hack
+ // The NSC stack requires a default gateway and only supports
+ // single-interface nodes. The below is a hack, but
+ // it turns out that we can pass the interface address to nsc as
+ // a default gateway. Bug 1398 has been opened to track this
+ // issue (NSC's limitation to single-interface nodes)
//
- // Just increment the last octet, this gives a decent chance of this being
- // 'enough'.
- //
- // All we need is another address on the same network as the interface. This
- // will force the stack to output the packet out of the network interface.
- addrBytes[3]++;
- addr = Ipv4Address::Deserialize (addrBytes);
- addrOss.str ("");
- addr.Print (addrOss);
+ // Previous versions of this code tried to assign the "next"
+ // IP address of the subnet but this was found to fail for
+ // some use cases in /30 subnets.
+
+ // XXX
m_nscStack->add_default_gateway (addrOss.str ().c_str ());
}
}