diff options
| author | Andrew Cooks <acooks.at.bda@gmail.com> | 2024-05-21 09:47:20 +1000 |
|---|---|---|
| committer | Andrew Cooks <acooks.at.bda@gmail.com> | 2024-05-28 14:05:56 +1000 |
| commit | 4d06e27569ae09cfb44cfa07b2c8d027ecf0fd72 (patch) | |
| tree | d2c5f0aeb60b0d7f8285fffabe5712c0ab5f0eac /ospf6d/ospf6_gr.c | |
| parent | f7712516d8ea19629d346eca1d5ad71831ec1f22 (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_gr.c')
| -rw-r--r-- | ospf6d/ospf6_gr.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ospf6d/ospf6_gr.c b/ospf6d/ospf6_gr.c index 34cb9706bd..ab119a4ea4 100644 --- a/ospf6d/ospf6_gr.c +++ b/ospf6d/ospf6_gr.c @@ -54,9 +54,7 @@ static int ospf6_gr_lsa_originate(struct ospf6_interface *oi, /* prepare buffer */ memset(buffer, 0, sizeof(buffer)); lsa_header = (struct ospf6_lsa_header *)buffer; - grace_lsa = - (struct ospf6_grace_lsa *)((caddr_t)lsa_header - + sizeof(struct ospf6_lsa_header)); + grace_lsa = (struct ospf6_grace_lsa *)ospf6_lsa_header_end(lsa_header); /* Put grace period. */ grace_lsa->tlv_period.header.type = htons(GRACE_PERIOD_TYPE); |
