View | Details | Raw Unified | Return to bug 857
Collapse All | Expand All

(-)a/src/internet-stack/ipv4-l3-protocol.cc (-2 / +2 lines)
 Lines 545-552    Link Here 
545
  // 4) packet is not broadcast, and is passed in with a route entry but route->GetGateway is not set (e.g., on-demand)
545
  // 4) packet is not broadcast, and is passed in with a route entry but route->GetGateway is not set (e.g., on-demand)
546
  // 5) packet is not broadcast, and route is NULL (e.g., a raw socket call, or ICMP)
546
  // 5) packet is not broadcast, and route is NULL (e.g., a raw socket call, or ICMP)
547
  
547
  
548
  // 1) packet is destined to limited broadcast address
548
  // 1) packet is destined to limited broadcast address or link-local multicast address
549
  if (destination.IsBroadcast ()) 
549
  if (destination.IsBroadcast () || destination.IsLocalMulticast ())
550
    {
550
    {
551
      NS_LOG_LOGIC ("Ipv4L3Protocol::Send case 1:  limited broadcast");
551
      NS_LOG_LOGIC ("Ipv4L3Protocol::Send case 1:  limited broadcast");
552
      ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment);
552
      ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment);
(-)a/src/node/ipv4-address.cc (+7 lines)
 Lines 240-245    Link Here 
240
  return (m_address >= 0xe0000000 && m_address <= 0xefffffff);
240
  return (m_address >= 0xe0000000 && m_address <= 0xefffffff);
241
}
241
}
242
242
243
bool 
244
Ipv4Address::IsLocalMulticast (void) const
245
{
246
  // Link-Local multicast address is 224.0.0.0/24
247
  return (m_address & 0xffffff00) == 0xe0000000;
248
}
249
243
void
250
void
244
Ipv4Address::Serialize (uint8_t buf[4]) const
251
Ipv4Address::Serialize (uint8_t buf[4]) const
245
{
252
{
(-)a/src/node/ipv4-address.h (+4 lines)
 Lines 112-117    Link Here 
112
    */
112
    */
113
  bool IsMulticast (void) const;
113
  bool IsMulticast (void) const;
114
  /**
114
  /**
115
    * \return true only if address is in local multicast address scope, 224.0.0.0/24
116
    */
117
  bool IsLocalMulticast (void) const;
118
  /**
115
   * \brief Combine this address with a network mask
119
   * \brief Combine this address with a network mask
116
   *
120
   *
117
   * This method returns an IPv4 address that is this address combined
121
   * This method returns an IPv4 address that is this address combined
(-)a/src/routing/static-routing/ipv4-static-routing.cc (+14 lines)
 Lines 222-227    Link Here 
222
  Ptr<Ipv4Route> rtentry = 0;
222
  Ptr<Ipv4Route> rtentry = 0;
223
  uint16_t longest_mask = 0;
223
  uint16_t longest_mask = 0;
224
  uint32_t shortest_metric = 0xffffffff;
224
  uint32_t shortest_metric = 0xffffffff;
225
  /* when sending on local multicast, there have to be interface specified */
226
  if (dest.IsLocalMulticast ())
227
    {
228
      NS_ASSERT_MSG (oif, "Try to send on link-local multicast address, and no interface index is given!");
229
230
      rtentry = Create<Ipv4Route> ();
231
      rtentry->SetDestination (dest);
232
      rtentry->SetGateway (Ipv4Address::GetZero ());
233
      rtentry->SetOutputDevice (oif);
234
      rtentry->SetSource (m_ipv4->GetAddress (oif->GetIfIndex (), 0).GetLocal ());
235
      return rtentry;
236
    }
237
238
225
  for (NetworkRoutesI i = m_networkRoutes.begin (); 
239
  for (NetworkRoutesI i = m_networkRoutes.begin (); 
226
       i != m_networkRoutes.end (); 
240
       i != m_networkRoutes.end (); 
227
       i++) 
241
       i++) 

Return to bug 857