for ipv6 linux stack helper diff -r 2bbac970450e src/internet/model/ipv6-interface.cc --- a/src/internet/model/ipv6-interface.cc Sat Jan 04 22:41:34 2014 +0900 +++ b/src/internet/model/ipv6-interface.cc Tue Jan 07 00:23:58 2014 +0900 @@ -116,8 +116,16 @@ return; /* no NDISC cache for ip6-localhost */ } - Ptr icmpv6 = m_node->GetObject ()->GetIcmpv6 (); - m_ndCache = icmpv6->CreateCache (m_device, this); + Ptr proto = m_node->GetObject ()->GetProtocol (Icmpv6L4Protocol::GetStaticProtocolNumber ()); + Ptr icmpv6; + if (proto) + { + icmpv6 = proto->GetObject (); + } + if (icmpv6) + { + m_ndCache = icmpv6->CreateCache (m_device, this); + } } void Ipv6Interface::SetNode (Ptr node) @@ -216,7 +224,12 @@ if (!addr.IsAny () || !addr.IsLocalhost ()) { /* DAD handling */ - Ptr icmpv6 = m_node->GetObject ()->GetIcmpv6 (); + Ptr proto = m_node->GetObject ()->GetProtocol (Icmpv6L4Protocol::GetStaticProtocolNumber ()); + Ptr icmpv6; + if (proto) + { + icmpv6 = proto->GetObject (); + } if (icmpv6 && icmpv6->IsAlwaysDad ()) { diff -r 2bbac970450e src/internet/model/ipv6.h --- a/src/internet/model/ipv6.h Sat Jan 04 22:41:34 2014 +0900 +++ b/src/internet/model/ipv6.h Tue Jan 07 00:23:58 2014 +0900 @@ -31,6 +31,7 @@ #include "ns3/ipv6-address.h" #include "ipv6-interface-address.h" +#include "ns3/ip-l4-protocol.h" namespace ns3 { @@ -304,6 +305,13 @@ virtual void SetForwarding (uint32_t interface, bool val) = 0; /** + * \brief Get L4 protocol by protocol number. + * \param protocolNumber protocol number + * \return corresponding Ipv6L4Protocol or 0 if not found + */ + virtual Ptr GetProtocol (int protocolNumber) const = 0; + + /** * \brief Register the IPv6 Extensions. */ virtual void RegisterExtensions () = 0;