Bug 914 - check local callback status before invoking LocalDelivery
check local callback status before invoking LocalDelivery
Status: RESOLVED DUPLICATE of bug 926
Product: ns-3
Classification: Unclassified
Component: olsr
pre-release
All All
: P5 normal
Assigned To: Gustavo J. A. M. Carneiro
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-17 10:03 EDT by Tom Henderson
Modified: 2010-05-31 08:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2010-05-17 10:03:47 EDT
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.
Comment 1 Gustavo J. A. M. Carneiro 2010-05-31 08:51:11 EDT

*** This bug has been marked as a duplicate of bug 926 ***