]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Ensure we have some non header lsa data
authorDonald Sharp <sharpd@nvidia.com>
Tue, 10 Aug 2021 23:21:19 +0000 (19:21 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 14 Sep 2021 17:07:06 +0000 (13:07 -0400)
In some cases FRR is receiving a lsa data packet
with a length set to the length of the header only.
If we are expecting data from a peer in the form
of lsa data.  Let's enforce it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ospfd/ospf_opaque.h
ospfd/ospf_packet.c

index 7d401c3dcc18a5adf074af0a602672caf74a29d0..aeaeea91898232b59b5391301327fdb56b64d2bf 100644 (file)
@@ -77,6 +77,8 @@
 
 #define OPAQUE_TYPE_RANGE_RESERVED(type) (127 < (type) && (type) <= 255)
 
+#define OSPF_OPAQUE_LSA_MIN_SIZE 4U
+
 #define VALID_OPAQUE_INFO_LEN(lsahdr)                                          \
        ((ntohs((lsahdr)->length) >= sizeof(struct lsa_header))                \
         && ((ntohs((lsahdr)->length) < OSPF_MAX_LSA_SIZE))                    \
index 1efdfee3b4972cfddc15f961560ad183ea89e73c..7c32c18d4cfe29fa1942f80db25545bc244a9f81 100644 (file)
@@ -108,9 +108,9 @@ static const uint16_t ospf_lsa_minlen[] = {
        0,
        OSPF_AS_EXTERNAL_LSA_MIN_SIZE,
        0,
-       0,
-       0,
-       0,
+       OSPF_OPAQUE_LSA_MIN_SIZE,
+       OSPF_OPAQUE_LSA_MIN_SIZE,
+       OSPF_OPAQUE_LSA_MIN_SIZE,
 };
 
 /* for ospf_check_auth() */