Hi Claudio,
could you please have a look to the following patch.
It removes a check that tries to make sure, a router lsa has at
least one link.
I have seen a problem with the check in the following situation:
On a router with only one ospf speaking interface, the link on this
interface goes down. The ospfd notice that, but doesn't generate
a router lsa for itself, because nlinks is zero. So the router doesn't
realize that it can not reach learned ospf routes anymore. The routes
get not deleted from the kernel routing table.
Sometimes I have also seen multiple times the same ospf routes inside
the kernel routing table, after the interface went up again. But this
is not reproducable all the time.
Do you see any situations were a router lsa with nlinks 0 could cause
trouble?
Regards,
Florian
Index: ospfe.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospfd/ospfe.c,v
retrieving revision 1.87
diff -u -p -r1.87 ospfe.c
--- ospfe.c 13 Nov 2013 20:43:00 -0000 1.87
+++ ospfe.c 12 Feb 2014 18:22:43 -0000
@@ -1020,7 +1020,7 @@ orig_rtr_lsa(struct area *area)
memcpy(ibuf_seek(buf, LS_CKSUM_OFFSET, sizeof(chksum)),
&chksum, sizeof(chksum));
- if (self && num_links)
+ if (self)
imsg_compose_event(iev_rde, IMSG_LS_UPD, self->peerid, 0,
-1, buf->buf, ibuf_size(buf));
else
Index: rde_lsdb.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospfd/rde_lsdb.c,v
retrieving revision 1.49
diff -u -p -r1.49 rde_lsdb.c
--- rde_lsdb.c 14 Aug 2013 20:16:09 -0000 1.49
+++ rde_lsdb.c 12 Feb 2014 18:22:43 -0000
@@ -306,10 +306,6 @@ lsa_router_check(struct lsa *lsa, u_int1
}
nlinks = ntohs(lsa->data.rtr.nlinks);
- if (nlinks == 0) {
- log_warnx("lsa_check: invalid LSA router packet");
- return (0);
- }
for (i = 0; i < nlinks; i++) {
rtr_link = (struct lsa_rtr_link *)(buf + off);
off += sizeof(struct lsa_rtr_link);