summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-06-06 02:08:27 +0200
committerOndrej Filip <feela@network.cz>2000-06-06 02:08:27 +0200
commiteb436e16fd85340d3403a033ee86f973428a2f08 (patch)
tree7bef00ed3b6a56c0178484ae7bd8eb9a763fb803 /proto
parente5b5d18c1c8b33e76e954c0696e056fc11701631 (diff)
downloadbird-eb436e16fd85340d3403a033ee86f973428a2f08.tar
bird-eb436e16fd85340d3403a033ee86f973428a2f08.zip
NBMA networks seems to work, but this should be better. :-)
Diffstat (limited to 'proto')
-rw-r--r--proto/ospf/lsack.c9
-rw-r--r--proto/ospf/lsupd.c4
-rw-r--r--proto/ospf/packet.c12
-rw-r--r--proto/ospf/packet.h1
4 files changed, 24 insertions, 2 deletions
diff --git a/proto/ospf/lsack.c b/proto/ospf/lsack.c
index f79aa2a..b7c1367 100644
--- a/proto/ospf/lsack.c
+++ b/proto/ospf/lsack.c
@@ -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);
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
index e28b6a7..8059c36 100644
--- a/proto/ospf/lsupd.c
+++ b/proto/ospf/lsupd.c
@@ -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
{
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index fc60a42..88234da 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -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);
+}
+
diff --git a/proto/ospf/packet.h b/proto/ospf/packet.h
index 23999a2..4e132fa 100644
--- a/proto/ospf/packet.h
+++ b/proto/ospf/packet.h
@@ -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_ */