diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2015-03-03 10:30:27 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-06-08 18:52:19 +0200 |
commit | 81382410ed4203f5cb9283204bed635cb80df7d2 (patch) | |
tree | 1b1f6408dc7e05ee70d9879ca10c6920dc96d669 /ospf6d/ospf6_route.h | |
parent | lib, vtysh: reduce unneccessary C extension usage (diff) | |
download | frr-81382410ed4203f5cb9283204bed635cb80df7d2.tar.xz frr-81382410ed4203f5cb9283204bed635cb80df7d2.zip |
ospf6d: use existing union, avoid strict-aliasing
There are preexisting fields u.lp.id and u.lp.adv_router in struct
prefix that do the same thing as these type-punning pointer derefs.
Use these and shut up the strict-aliasing warnings.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 0de0138a9146074f268245193e45c9376d998722)
Diffstat (limited to 'ospf6d/ospf6_route.h')
-rw-r--r-- | ospf6d/ospf6_route.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index b3be66c28..e783b72d8 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -251,14 +251,13 @@ extern const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX]; #define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST)) -/* XXX: This gives GCC heartburn aboutbreaking aliasing rules. */ #define ospf6_linkstate_prefix_adv_router(x) \ - ((x)->u.prefix4.s_addr) + ((x)->u.lp.id.s_addr) #define ospf6_linkstate_prefix_id(x) \ - ((x)->u.prefix6.s6_addr32[1]) + ((x)->u.lp.adv_router.s_addr) #define ADV_ROUTER_IN_PREFIX(x) \ - ((x)->u.prefix4.s_addr) + ((x)->u.lp.id.s_addr) /* Function prototype */ extern void ospf6_linkstate_prefix (u_int32_t adv_router, u_int32_t id, |