summaryrefslogtreecommitdiff
path: root/lib/ipaddr.h
diff options
context:
space:
mode:
authorSri Mohana Singamsetty <srimohans@gmail.com>2019-05-17 11:39:27 -0700
committerGitHub <noreply@github.com>2019-05-17 11:39:27 -0700
commit7cfaf4b3394de78bc1a48b22d84f118a80f88b98 (patch)
tree87ddfdf3ed07c95ca01c470b49dfaa46b26ea2ce /lib/ipaddr.h
parent02f4c3ab5b33f5f17b592ef7787797a0e43d0785 (diff)
parent53ca01e52c487954f68ab7a76f163cf465fb9209 (diff)
Merge pull request #4168 from qlyoung/vrrp
VRRP
Diffstat (limited to 'lib/ipaddr.h')
-rw-r--r--lib/ipaddr.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ipaddr.h b/lib/ipaddr.h
index f4ddadc66e..1c2399fdd3 100644
--- a/lib/ipaddr.h
+++ b/lib/ipaddr.h
@@ -56,6 +56,9 @@ struct ipaddr {
#define SET_IPADDR_V4(p) (p)->ipa_type = IPADDR_V4
#define SET_IPADDR_V6(p) (p)->ipa_type = IPADDR_V6
+#define IPADDRSZ(p) \
+ (IS_IPADDR_V4((p)) ? sizeof(struct in_addr) : sizeof(struct in6_addr))
+
static inline int str2ipaddr(const char *str, struct ipaddr *ip)
{
int ret;