]> git.puffer.fish Git - mirror/frr.git/commit
ospf6d: replace TLV_HDR_TOP macro with lsdesc_start function
authorAndrew Cooks <acooks.at.bda@gmail.com>
Thu, 18 Jul 2024 02:56:14 +0000 (12:56 +1000)
committerAndrew Cooks <acooks.at.bda@gmail.com>
Mon, 16 Sep 2024 08:38:16 +0000 (18:38 +1000)
commitd0366de57c11a7698945acc1dfaf8a6bead1f6f5
treeba30a659bcfc254368c3dd56fe12226e7f188de3
parent1bb4955371b234e3833fbe8421bf31838d9aae7b
ospf6d: replace TLV_HDR_TOP macro with lsdesc_start function

The original TLV_HDR_TOP implementation only worked for Graceful Restart
LSAs, because they had no "LSA body".

This change introduces a body size lookup table and changes the
macro to a function that accounts for the LSA body for all LSA types,
and provides type checking on the provided pointer before arithmetic.

It also removes the open type casting and pointer arithmetic.

The introduced lsdesc_start() is used to find the start of a descriptor,
and will be used for TLVs in E-LSAs as well as old LSA.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
ospf6d/ospf6_gr_helper.c
ospf6d/ospf6_intra.c
ospf6d/ospf6_lsa.c
ospf6d/ospf6_lsa.h
ospf6d/ospf6_tlv.h