diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-08-02 10:38:11 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-22 02:26:05 +0100 |
commit | 4ed0af7013a8885e7c18d7ed532b16c5be5f2df9 (patch) | |
tree | fe7784732eff1c51ae06c5e52ebde044d489c516 /lib | |
parent | pimd: Add rs_timer display (diff) | |
download | frr-4ed0af7013a8885e7c18d7ed532b16c5be5f2df9.tar.xz frr-4ed0af7013a8885e7c18d7ed532b16c5be5f2df9.zip |
lib, pimd: Fix borked up prefix code
Fix the struct prefix to be an actual struct prefix_sg.
This cleans up a bunch of code to make it look nicer.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/prefix.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index 4878fcfdd..a2cdfe96f 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -74,20 +74,13 @@ struct prefix { u_char prefix; struct in_addr prefix4; -#ifdef HAVE_IPV6 struct in6_addr prefix6; -#endif /* HAVE_IPV6 */ struct { struct in_addr id; struct in_addr adv_router; } lp; struct ethaddr prefix_eth; /* AF_ETHERNET */ - struct - { - struct in_addr src; - struct in_addr grp; - } sg; u_char val[8]; uintptr_t ptr; } u __attribute__ ((aligned (8))); @@ -102,14 +95,12 @@ struct prefix_ipv4 }; /* IPv6 prefix structure. */ -#ifdef HAVE_IPV6 struct prefix_ipv6 { u_char family; u_char prefixlen; struct in6_addr prefix __attribute__ ((aligned (8))); }; -#endif /* HAVE_IPV6 */ struct prefix_ls { @@ -143,6 +134,14 @@ struct prefix_ptr uintptr_t prefix __attribute__ ((aligned (8))); }; +struct prefix_sg +{ + u_char family; + u_char prefixlen; + struct in_addr src __attribute ((aligned (8))); + struct in_addr grp; +}; + /* helper to get type safety/avoid casts on calls * (w/o this, functions accepting all prefix types need casts on the caller * side, which strips type safety since the cast will accept any pointer @@ -276,7 +275,6 @@ extern in_addr_t ipv4_broadcast_addr (in_addr_t hostaddr, int masklen); extern int netmask_str2prefix_str (const char *, const char *, char *); -#ifdef HAVE_IPV6 extern struct prefix_ipv6 *prefix_ipv6_new (void); extern void prefix_ipv6_free (struct prefix_ipv6 *); extern int str2prefix_ipv6 (const char *, struct prefix_ipv6 *); @@ -303,8 +301,6 @@ static inline int ipv6_martian (struct in6_addr *addr) return 0; } -#endif /* HAVE_IPV6 */ - extern int all_digit (const char *); /* NOTE: This routine expects the address argument in network byte order. */ |