Commit bc591061 authored by Ondrej Zajicek (work)'s avatar Ondrej Zajicek (work)
Browse files

OSPF: Packets on PtP networks should be always sent to AllSPFRouters

As specified in RFC 2328 8.1: "On physical point-to-point networks,
the IP destination is always set to the address AllSPFRouters."

Note that this likely break setups with multiple neighbors on a network
configured as PtP, which worked before. These should be configured as
PtMP.

Thanks to Senthil Kumar Nagappan for the original patch and to Joakim
Tjernlund for suggestions.
parent 1647923b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ ospf_do_send_dbdes(struct ospf_proto *p, struct ospf_neighbor *n)
  OSPF_PACKET(ospf_dump_dbdes, n->ldd_buffer,
	      "DBDES packet sent to nbr %R on %s", n->rid, ifa->ifname);
  sk_set_tbuf(ifa->sk, n->ldd_buffer);
  ospf_send_to(ifa, n->ip);
  ospf_send_to_nbr(ifa, n);
  sk_set_tbuf(ifa->sk, NULL);
}

+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ ospf_send_lsack_(struct ospf_proto *p, struct ospf_neighbor *n, int queue)
  if (queue == ACKL_DIRECT)
  {
    OSPF_PACKET(ospf_dump_lsack, pkt, "LSACK packet sent to nbr %R on %s", n->rid, ifa->ifname);
    ospf_send_to(ifa, n->ip);
    ospf_send_to_nbr(ifa, n);
  }
  else
  {
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ ospf_send_lsreq(struct ospf_proto *p, struct ospf_neighbor *n)
  pkt->length = htons(length);

  OSPF_PACKET(ospf_dump_lsreq, pkt, "LSREQ packet sent to nbr %R on %s", n->rid, ifa->ifname);
  ospf_send_to(ifa, n->ip);
  ospf_send_to_nbr(ifa, n);
}


+1 −1
Original line number Diff line number Diff line
@@ -420,7 +420,7 @@ ospf_send_lsupd(struct ospf_proto *p, struct top_hash_entry **lsa_list, uint lsa
    OSPF_PACKET(ospf_dump_lsupd, ospf_tx_buffer(ifa),
		"LSUPD packet sent to nbr %R on %s", n->rid, ifa->ifname);

    ospf_send_to(ifa, n->ip);
    ospf_send_to_nbr(ifa, n);
  }

  return i;
+3 −0
Original line number Diff line number Diff line
@@ -1058,6 +1058,9 @@ void ospf_verr_hook(sock *sk, int err);
void ospf_send_to(struct ospf_iface *ifa, ip_addr ip);
void ospf_send_to_iface(struct ospf_iface *ifa);

static inline void ospf_send_to_nbr(struct ospf_iface *ifa, struct ospf_neighbor *n)
{ ospf_send_to(ifa, (ifa->type == OSPF_IT_PTP) ? ifa->all_routers :  n->ip); }

static inline void ospf_send_to_all(struct ospf_iface *ifa)
{ ospf_send_to(ifa, ifa->all_routers); }

Loading