diff options
Diffstat (limited to 'ospf6d/ospf6_message.c')
| -rw-r--r-- | ospf6d/ospf6_message.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index a6ee8d8b01..33d15e7243 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -33,6 +33,7 @@ #include "ospf6_flood.h" #include "ospf6d.h" +#include "ospf6_tlv.h" #include "ospf6_gr.h" #include <netinet/ip6.h> #include "lib/libospf.h" @@ -1303,9 +1304,7 @@ static unsigned ospf6_lsa_examin(struct ospf6_lsa_header *lsah, 4 bytes of referenced link state ID. */ if (headeronly) break; - as_external_lsa = - (struct ospf6_as_external_lsa - *)((caddr_t)lsah + OSPF6_LSA_HEADER_SIZE); + as_external_lsa = lsa_after_header(lsah); exp_length = OSPF6_LSA_HEADER_SIZE + OSPF6_AS_EXTERNAL_LSA_MIN_SIZE; /* To find out if the last optional field (Referenced Link State @@ -1350,8 +1349,7 @@ static unsigned ospf6_lsa_examin(struct ospf6_lsa_header *lsah, by N>=0 IPv6 prefix blocks (with N declared beforehand). */ if (headeronly) break; - link_lsa = (struct ospf6_link_lsa *)((caddr_t)lsah - + OSPF6_LSA_HEADER_SIZE); + link_lsa = lsa_after_header(lsah); return ospf6_prefixes_examin( (struct ospf6_prefix *)((caddr_t)link_lsa + OSPF6_LINK_LSA_MIN_SIZE), @@ -1366,9 +1364,7 @@ static unsigned ospf6_lsa_examin(struct ospf6_lsa_header *lsah, */ if (headeronly) break; - intra_prefix_lsa = - (struct ospf6_intra_prefix_lsa - *)((caddr_t)lsah + OSPF6_LSA_HEADER_SIZE); + intra_prefix_lsa = lsa_after_header(lsah); return ospf6_prefixes_examin( (struct ospf6_prefix *)((caddr_t)intra_prefix_lsa |
