Bugzilla – Bug 914
check local callback status before invoking LocalDelivery
Last modified: 2010-05-31 08:51:11 UTC
Reported by Ken Renard: In ns3::olsr::RoutingProtocol::RouteInput(), the 'LocalDeliverCallback lcb' parameter might be passed in as a NULL callback if the higher level routing protocol (such as ListRouting) has already delivered this packet locally as a multicast packet. My 'fix' is simply to check to make sure that lcb.IsNull() is false before trying to call it. Attached is a simple program that demonstrates this. Here is a simple patch for addressing this > --- olsr-routing-protocol.cc (revision 468) > +++ olsr-routing-protocol.cc (revision 469) > @@ -3004,7 +3004,10 @@ > if (m_ipv4->IsDestinationAddress (dst, iif)) > { > NS_LOG_LOGIC ("Local delivery to " << dst); > - lcb (p, header, iif); > + if (lcb.IsNull() == false) > + { > + lcb (p, header, iif); > + } > return true; > } The method Ipv4L3Protocol::IsDestinationAddress() is undocumented, but it clearly returns true for any multicast or broadcast; it may be better to handle unicast, broadcast, and multicast with separate methods.
*** This bug has been marked as a duplicate of bug 926 ***