summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_lsa.c
diff options
context:
space:
mode:
authorAndrew Cooks <acooks.at.bda@gmail.com>2024-05-21 09:47:20 +1000
committerAndrew Cooks <acooks.at.bda@gmail.com>2024-05-28 14:05:56 +1000
commit4d06e27569ae09cfb44cfa07b2c8d027ecf0fd72 (patch)
treed2c5f0aeb60b0d7f8285fffabe5712c0ab5f0eac /ospf6d/ospf6_lsa.c
parentf7712516d8ea19629d346eca1d5ad71831ec1f22 (diff)
ospf6d: replace OSPF6_LSA_HEADER_END macro
Replacing the macro with an inline function allows the compiler to check the parameter type. Use the replacement function consistently to reduce the number of open coded pointer cast plus offset calculations. use tools/indent.py to reformat all occurences of its use. Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
Diffstat (limited to 'ospf6d/ospf6_lsa.c')
-rw-r--r--ospf6d/ospf6_lsa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index bc39579653..24643164c5 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -63,10 +63,10 @@ struct ospf6 *ospf6_get_by_lsdb(struct ospf6_lsa *lsa)
static int ospf6_unknown_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
json_object *json_obj, bool use_json)
{
- uint8_t *start, *end, *current;
+ char *start, *end, *current;
- start = (uint8_t *)lsa->header + sizeof(struct ospf6_lsa_header);
- end = (uint8_t *)lsa->header + ntohs(lsa->header->length);
+ start = ospf6_lsa_header_end(lsa->header);
+ end = (char *)lsa->header + ntohs(lsa->header->length);
if (use_json) {
json_object_string_add(json_obj, "lsaType", "unknown");
@@ -234,8 +234,8 @@ int ospf6_lsa_is_changed(struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2)
if (length <= 0)
return 0;
- return memcmp(OSPF6_LSA_HEADER_END(lsa1->header),
- OSPF6_LSA_HEADER_END(lsa2->header), length);
+ return memcmp(ospf6_lsa_header_end(lsa1->header),
+ ospf6_lsa_header_end(lsa2->header), length);
}
/* ospf6 age functions */