Possible bug in ospf_lsupd_receive

Benjamin Paterson paterson.b at gmail.com
Mon May 14 14:37:39 CEST 2012


Hi guys,

I think there's an endianness problem in ospf_lsupd_receive. On the lines
where the program checks lsa->type or uses the LSA_SCOPE macro, it has not
previously converted lsa->type to host representation. I saw this problem
as I created a new LSA class with type BFF0, which has area scope. It was
incorrectly displaying "<WARN> Received LSA with invalid scope" messages
and refusing to add the LSAs to the database. I checked and at the line
513, if ((LSA_SCOPE(lsa) == LSA_SCOPE_RES)) was evaluating as true because
lsa->type was F0BF, which is a reserved type. All the other LSA types are
also inverted, but it doesn't pose a problem for the common LSA types as
their first hex digit is usually 0 if they are misrepresented (0800 for
link LSA, 0120 for router LSA etc).

The problem can be fixed by putting ntohlsah(lsa, &lsatmp); before the
checks and using &lsatmp instead of lsa for checks.

Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20120514/d0e7c19c/attachment.html>


More information about the Bird-users mailing list