summaryrefslogtreecommitdiffstats
path: root/proto/ospf/lsupd.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-08-27 18:25:46 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-08-27 18:25:46 +0200
commit061ab802a67cfc336785f6daeecdcbd4910734ed (patch)
treea3815a619b1e3e553638e4aad6508757e5bc6f7a /proto/ospf/lsupd.c
parentb49e6f5a65d437cb7e7bdefe8397e0f550496012 (diff)
downloadbird-061ab802a67cfc336785f6daeecdcbd4910734ed.tar
bird-061ab802a67cfc336785f6daeecdcbd4910734ed.zip
Temporary OSPFv3 development commit
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r--proto/ospf/lsupd.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
index efaafe8..72861bd 100644
--- a/proto/ospf/lsupd.c
+++ b/proto/ospf/lsupd.c
@@ -78,13 +78,32 @@ ospf_lsa_flooding_allowed(struct ospf_lsa_header *lsa, u32 domain, struct ospf_i
#else /* OSPFv3 */
+static int
+unknown_lsa_type(struct ospf_lsa_header *lsa)
+{
+ switch (lsa->type)
+ {
+ case LSA_T_RT:
+ case LSA_T_NET:
+ case LSA_T_SUM_NET:
+ case LSA_T_SUM_RT:
+ case LSA_T_EXT:
+ case LSA_T_LINK:
+ case LSA_T_PREFIX:
+ return 0;
+
+ default:
+ return 1;
+ }
+}
+
int
ospf_lsa_flooding_allowed(struct ospf_lsa_header *lsa, u32 domain, struct ospf_iface *ifa)
{
u32 scope = LSA_SCOPE(lsa);
/* 4.5.2 (Case 2) */
- if (unknown_type(lsa) && !(lsa->type & LSA_UBIT))
+ if (unknown_lsa_type(lsa) && !(lsa->type & LSA_UBIT))
scope = LSA_SCOPE_LINK;
switch (scope)
@@ -444,9 +463,11 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
/* pg 143 (1) */
chsum = lsa->checksum;
+ log(L_WARN "Checking rcv %R %R %d (len %d)", ntohl(lsa->id), ntohl(lsa->rt), ntoht(lsa->type), ntohs(lsa->length));
+ buf_dump("RCV", lsa, ntohs(lsa->length));
if (chsum != lsasum_check(lsa, NULL))
{
- log(L_WARN "Received bad lsa checksum from %I", n->ip);
+ log(L_WARN "Received bad lsa checksum from %I: %x %x", n->ip, chsum, lsa->checksum);
continue;
}