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

(-)a/src/olsr/model/olsr-routing-protocol.cc (-9 / +5 lines)
 Lines 318-334    Link Here 
318
        continue;
318
        continue;
319
319
320
      // Create a socket to listen only on this interface
320
      // Create a socket to listen only on this interface
321
      Ptr<Socket> socket = Socket::CreateSocket (GetObject<Node> (), 
321
      Ptr<Socket> socket = Socket::CreateSocket (GetObject<Node> (), UdpSocketFactory::GetTypeId ());
322
                                                 UdpSocketFactory::GetTypeId());
322
      socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvOlsr, this));
323
      socket->BindToNetDevice (m_ipv4->GetNetDevice (i));
324
      socket->Bind (InetSocketAddress (m_ipv4->GetAddress (i, 0).GetLocal (), OLSR_PORT_NUMBER));
323
      socket->SetAllowBroadcast (true);
325
      socket->SetAllowBroadcast (true);
324
      InetSocketAddress inetAddr (m_ipv4->GetAddress (i, 0).GetLocal (), OLSR_PORT_NUMBER);
325
      socket->SetRecvCallback (MakeCallback (&RoutingProtocol::RecvOlsr,  this));
326
      if (socket->Bind (inetAddr))
327
        {
328
          NS_FATAL_ERROR ("Failed to bind() OLSR socket");
329
        }
330
      m_socketAddresses[socket] = m_ipv4->GetAddress (i, 0);
326
      m_socketAddresses[socket] = m_ipv4->GetAddress (i, 0);
331
327
      
332
      canRunOlsr = true;
328
      canRunOlsr = true;
333
    }
329
    }
334
330

Return to bug 1040