]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
NBMA networks seems to work, but this should be better. :-)
authorOndrej Filip <feela@network.cz>
Tue, 6 Jun 2000 00:08:27 +0000 (00:08 +0000)
committerOndrej Filip <feela@network.cz>
Tue, 6 Jun 2000 00:08:27 +0000 (00:08 +0000)
proto/ospf/lsack.c
proto/ospf/lsupd.c
proto/ospf/packet.c
proto/ospf/packet.h

index f79aa2ae4ac6bdca81e6721b775c3ffabb107b8a..b7c136731198d97af23854b6413f1dc59aa4a035 100644 (file)
@@ -113,7 +113,14 @@ ospf_lsack_delay_tx(struct ospf_neighbor *n)
        }
        else
        {
-          sk_send_to_agt(sk, len, ifa, NEIGHBOR_EXCHANGE);
+          if((ifa->state==OSPF_IS_DR)||(ifa->state==OSPF_IS_BACKUP))
+         {
+            sk_send_to_agt(sk, len, ifa, NEIGHBOR_EXCHANGE);
+         }
+         else
+         {
+            sk_send_to_bdr(sk, len, ifa);
+         }
        }
 
        fill_ospf_pkt_hdr(n->ifa, pk, LSACK_P);
index e28b6a7edfe405e4207597837b633f0c3913bfd6..8059c36961bc508cd9452983b1e2be3282b86a36 100644 (file)
@@ -149,7 +149,9 @@ flood_lsa(struct ospf_neighbor *n, struct ospf_lsa_header *hn,
 
       if(ifa->type==OSPF_IT_NBMA)
       {
-        sk_send_to_agt(sk ,len, ifa, NEIGHBOR_EXCHANGE);
+        if((ifa->state==OSPF_IS_BACKUP)||(ifa->state==OSPF_IS_DR))
+          sk_send_to_agt(sk ,len, ifa, NEIGHBOR_EXCHANGE);
+       else  sk_send_to_bdr(sk ,len, ifa);
       }
       else
       {
index fc60a4200dd358b32974995efd565b1f81816a73..88234da12b3debc4878fce72cac4d940716ae259 100644 (file)
@@ -192,3 +192,15 @@ sk_send_to_agt(sock *sk, u16 len, struct ospf_iface *ifa, u8 state)
     if(n->state>=state)
       sk_send_to(sk, len, n->ip, OSPF_PROTO);
 }                                                                       
+
+void
+sk_send_to_bdr(sock *sk, u16 len, struct ospf_iface *ifa)
+{
+  struct ospf_neighbor *n;
+
+  if(ipa_compare(ifa->drip,ipa_from_u32(0))!=0)
+    sk_send_to(sk, len, ifa->drip, OSPF_PROTO);
+  if(ipa_compare(ifa->bdrip,ipa_from_u32(0))!=0)
+    sk_send_to(sk, len, ifa->bdrip, OSPF_PROTO);
+}
+
index 23999a23772dbe901a3a0b496c8021604c30b508..4e132fa6f9dda04b2c2a76e2c807978a40ee30f2 100644 (file)
@@ -17,5 +17,6 @@ int  ospf_rx_hook(sock *sk, int size);
 void ospf_tx_hook(sock *sk);
 void ospf_err_hook(sock *sk, int err);
 void sk_send_to_agt(sock *sk, u16 len, struct ospf_iface *ifa, u8 state);
+void sk_send_to_bdr(sock *sk, u16 len, struct ospf_iface *ifa);
 
 #endif /* _BIRD_OSPF_PACKET_H_ */