diff options
| author | Andrew Cooks <acooks.at.bda@gmail.com> | 2024-07-18 12:56:14 +1000 | 
|---|---|---|
| committer | Andrew Cooks <acooks.at.bda@gmail.com> | 2024-09-16 18:38:16 +1000 | 
| commit | d0366de57c11a7698945acc1dfaf8a6bead1f6f5 (patch) | |
| tree | ba30a659bcfc254368c3dd56fe12226e7f188de3 /ospf6d/ospf6_tlv.h | |
| parent | 1bb4955371b234e3833fbe8421bf31838d9aae7b (diff) | |
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>
Diffstat (limited to 'ospf6d/ospf6_tlv.h')
| -rw-r--r-- | ospf6d/ospf6_tlv.h | 3 | 
1 files changed, 0 insertions, 3 deletions
diff --git a/ospf6d/ospf6_tlv.h b/ospf6d/ospf6_tlv.h index f94d7f2621..a687a05939 100644 --- a/ospf6d/ospf6_tlv.h +++ b/ospf6d/ospf6_tlv.h @@ -27,9 +27,6 @@ struct tlv_header {  #define TLV_SIZE(tlvh) ((uint32_t)(TLV_HDR_SIZE + TLV_BODY_SIZE(tlvh))) -#define TLV_HDR_TOP(lsah)                                                      \ -	((struct tlv_header *)((char *)(lsah) + OSPF6_LSA_HEADER_SIZE)) -  #define TLV_HDR_NEXT(tlvh)                                                     \  	((struct tlv_header *)((char *)(tlvh) + TLV_SIZE(tlvh)))  | 
