ospf ptp link sending unicast packets instead of multicast; peer address config not required

Joakim Tjernlund Joakim.Tjernlund at infinera.com
Sat May 8 18:03:34 CEST 2021


On Sat, 2021-05-08 at 17:45 +0200, Joakim Tjernlund wrote:
> On Fri, 2021-05-07 at 14:03 +0000, Senthil Kumar Nagappan wrote:
> > Hi Jocke,
> > 
> > yes i missed to take care of the ospfv3/ipv6 cases wherever im sending using allospfrouters as src ip.
> > your are right, mcast changes in packet.c is mostly hack since im not comfortable with the bird code since i have only 1 week of bird code experience.
> > reason i did not change inside ospf_send_to() is,since dst address is one of the parameter to the function and i don't want to override inside it. 
> > In Hello.c, ospf_send_hello they do some what similar, checking different interface types before they call ospf_send_to()
> 
> Ondrej, what is your preference? Perhaps you want to do the impl. yourself?
> 
> 
>   Jocke

Meanwhile I did this:
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -415,7 +415,7 @@ ospf_rx_hook(sock *sk, uint len)
      * that (src_local || dst_local), therefore we are eliminating all
      * such cases.
      */
-    if (dst_mcast && !src_local)
+    if (ifa->type != OSPF_IT_PTP && dst_mcast && !src_local)
       return 1;
     if (!dst_mcast && !dst_local)
       return 1;
@@ -430,7 +430,7 @@ ospf_rx_hook(sock *sk, uint len)
      * RFC 5340 says that local (non-vlink) packets use
      * link-local src address, but does not enforce it. Strange.
      */
-    if (dst_mcast && !src_local)
+    if (ifa->type != OSPF_IT_PTP && dst_mcast && !src_local)
       LOG_PKT_WARN("Multicast packet received from non-link-local %I via %s",
                   sk->faddr, ifa->ifname);
   }
@@ -654,6 +654,12 @@ ospf_send_to(struct ospf_iface *ifa, ip_addr dst)
   struct ospf_packet *pkt = (struct ospf_packet *) sk->tbuf;
   uint plen = ntohs(pkt->length);
 
+  /* RFC : On physical point-to-point networks, the IP destination
+   * is always set to the address AllSPFRouters.
+   */
+  if (ifa->type == OSPF_IT_PTP)
+    dst = ifa->all_routers;
+
   if (ospf_is_v2(ifa->oa->po))
     ospf_pkt_finalize2(ifa, pkt, &plen);
   else


In your patch you also have:
--- a/proto/ospf/iface.c
+++ b/proto/ospf/iface.c
@@ -535,6 +535,9 @@ ospf_iface_stubby(struct ospf_iface_patt *ip, struct ifa *addr)
   if (ip->type == OSPF_IT_VLINK)
     return 0;
 
+  if (ip->type == OSPF_IT_PTP)
+    return 0;
+

What is that about? Is it unrelated to AllSPFRouters change?

 Jocke



More information about the Bird-users mailing list