diff options
| author | Andrew Cooks <acooks.at.bda@gmail.com> | 2024-07-19 13:04:05 +1000 |
|---|---|---|
| committer | Andrew Cooks <acooks.at.bda@gmail.com> | 2024-09-16 18:38:16 +1000 |
| commit | 1b64893e237399988998ad76799dd2ddcc4cbf8b (patch) | |
| tree | a4df6f5df24aa0dd8a2ab990c9958d41954da57b /ospf6d/ospf6_spf.c | |
| parent | 1290a06f5fcae26bdf941f0aedda20150ab01ba3 (diff) | |
ospf6d: replace ospf6_lsa_header_end()
The void * return type of the replacement enables the removal of a
cast at every point of use, and the name no longer suggests that it
points to the last byte of the header.
Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
Diffstat (limited to 'ospf6d/ospf6_spf.c')
| -rw-r--r-- | ospf6d/ospf6_spf.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 5c6c1f0f26..5f2c5a6c47 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -290,8 +290,7 @@ static void ospf6_nexthop_calc(struct ospf6_vertex *w, struct ospf6_vertex *v, != lsa->header->id) continue; - link_lsa = (struct ospf6_link_lsa *)ospf6_lsa_header_end( - lsa->header); + link_lsa = lsa_after_header(lsa->header); if (IS_OSPF6_DEBUG_SPF(PROCESS)) { inet_ntop(AF_INET6, &link_lsa->linklocal_addr, buf, sizeof(buf)); @@ -1136,8 +1135,7 @@ int ospf6_ase_calculate_route(struct ospf6 *ospf6, struct ospf6_lsa *lsa, return 0; } - external = (struct ospf6_as_external_lsa *)ospf6_lsa_header_end( - lsa->header); + external = lsa_after_header(lsa->header); prefix.family = AF_INET6; prefix.prefixlen = external->prefix.prefix_length; ospf6_prefix_in6_addr(&prefix.u.prefix6, external, &external->prefix); |
