diff options
author | paul <paul> | 2003-04-03 01:27:01 +0000 |
---|---|---|
committer | paul <paul> | 2003-04-03 01:27:01 +0000 |
commit | d18258304a79b459fe768e63f27efd17aa1fa78f (patch) | |
tree | d731805699f7391f33a13933e4b522580573be0a /ospfd | |
parent | 05351a28c06c0b27e6aeb7d3c7801123c0242476 (diff) |
From: David Watson <dwatson@eecs.umich.edu>
Subject: [zebra 18573] PATCH ospfd: byte order error in assert statement
I found a bug in the ospfd code tickled this morning by a Type 1
LSA with exactly 62 entries (LSA length of 768, or 0x0300).
A missing ntohs in ospf_lsa.c:ospf_lsa_different() causes an assert
statement to fail, stopping ospfd.
> assert (l1->data->length > OSPF_LSA_HEADER_SIZE);
So, a length of type 768 turns into a length of 3 which is
obviously less than 20.
David
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_lsa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index e01dbd0d..45b554fb 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -2839,7 +2839,7 @@ ospf_lsa_different (struct ospf_lsa *l1, struct ospf_lsa *l2) if (l1->data->length == 0) return 1; - assert (l1->data->length > OSPF_LSA_HEADER_SIZE); + assert ( ntohs(l1->data->length) > OSPF_LSA_HEADER_SIZE); p1 = (char *) l1->data; p2 = (char *) l2->data; |