]> git.puffer.fish Git - mirror/frr.git/commitdiff
Set destination for PtP links to OSPF_ALLSPFROUTERS.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Fri, 30 May 2008 14:04:39 +0000 (16:04 +0200)
committerJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Mon, 25 Aug 2008 07:52:06 +0000 (09:52 +0200)
Update ospf_db_desc_send(), ospf_ls_upd_queue_send() and ospf_ls_req_send()
to always use OSPF_ALLSPFROUTERS for PtP links.

See RFC 2328, chap 8.1 for details:

    "The IP destination address for the packet is selected as
     follows.  On physical point-to-point networks, the IP
     destination is always set to the address AllSPFRouters."

Without this, it won't be possible to establish adjacencies on
multiple unnumbered links to the same router.
ChangeLog:
2008-07-25 Joakim Tjernlund <Joakim.Tjernlund@transmode.se>

* ospfd/ospf_packet.c: Set destination for PtP links to
  OSPF_ALLSPFROUTERS.

ospfd/ospf_packet.c

index a778a50b5e58113d263f0e242004b80b0ca81ba6..ed342e7fcd0ddec938505faee02154f3e8be0e13 100644 (file)
@@ -3151,7 +3151,10 @@ ospf_db_desc_send (struct ospf_neighbor *nbr)
   op->length = length;
 
   /* Decide destination address. */
-  op->dst = nbr->address.u.prefix4;
+  if (oi->type == OSPF_IFTYPE_POINTOPOINT) 
+    op->dst.s_addr = htonl (OSPF_ALLSPFROUTERS);
+  else
+    op->dst = nbr->address.u.prefix4;
 
   /* Add packet to the interface output queue. */
   ospf_packet_add (oi, op);
@@ -3210,7 +3213,10 @@ ospf_ls_req_send (struct ospf_neighbor *nbr)
   op->length = length;
 
   /* Decide destination address. */
-  op->dst = nbr->address.u.prefix4;
+  if (oi->type == OSPF_IFTYPE_POINTOPOINT) 
+    op->dst.s_addr = htonl (OSPF_ALLSPFROUTERS);
+  else
+    op->dst = nbr->address.u.prefix4;
 
   /* Add packet to the interface output queue. */
   ospf_packet_add (oi, op);
@@ -3326,7 +3332,10 @@ ospf_ls_upd_queue_send (struct ospf_interface *oi, struct list *update,
   op->length = length;
 
   /* Decide destination address. */
-  op->dst.s_addr = addr.s_addr;
+  if (oi->type == OSPF_IFTYPE_POINTOPOINT) 
+    op->dst.s_addr = htonl (OSPF_ALLSPFROUTERS);
+  else
+    op->dst.s_addr = addr.s_addr;
 
   /* Add packet to the interface output queue. */
   ospf_packet_add (oi, op);
@@ -3403,13 +3412,12 @@ ospf_ls_upd_send (struct ospf_neighbor *nbr, struct list *update, int flag)
   /* Decide destination address. */
   if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
     p.prefix = oi->vl_data->peer_addr;
+  else if (oi->type == OSPF_IFTYPE_POINTOPOINT) 
+     p.prefix.s_addr = htonl (OSPF_ALLSPFROUTERS);
   else if (flag == OSPF_SEND_PACKET_DIRECT)
      p.prefix = nbr->address.u.prefix4;
   else if (oi->state == ISM_DR || oi->state == ISM_Backup)
      p.prefix.s_addr = htonl (OSPF_ALLSPFROUTERS);
-  else if ((oi->type == OSPF_IFTYPE_POINTOPOINT) 
-          && (flag == OSPF_SEND_PACKET_INDIRECT))
-     p.prefix.s_addr = htonl (OSPF_ALLSPFROUTERS);
   else if (oi->type == OSPF_IFTYPE_POINTOMULTIPOINT)
      p.prefix.s_addr = htonl (OSPF_ALLSPFROUTERS);
   else