diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-13 12:08:38 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-13 12:08:38 -0400 |
| commit | 1f35b46a2f35d59b86ed3ee557aa1c9fcf2fcac9 (patch) | |
| tree | 27de606b3510b126766ac7a0ac9eb8ddf4573ab0 /lib/prefix.h | |
| parent | d47ae3db4cf14c72d8468d61113ac88e19235791 (diff) | |
| parent | c1a003878246ccc84ab5986558ca959f4545f738 (diff) | |
Merge branch 'master' into docuser
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/prefix.h')
| -rw-r--r-- | lib/prefix.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index 5bf7d498c1..1724225817 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -310,9 +310,9 @@ extern void prefix_ipv4_free(struct prefix_ipv4 *); extern int str2prefix_ipv4(const char *, struct prefix_ipv4 *); extern void apply_mask_ipv4(struct prefix_ipv4 *); -#define PREFIX_COPY(DST, SRC) \ +#define PREFIX_COPY(DST, SRC) \ *((struct prefix *)(DST)) = *((const struct prefix *)(SRC)) -#define PREFIX_COPY_IPV4(DST, SRC) \ +#define PREFIX_COPY_IPV4(DST, SRC) \ *((struct prefix_ipv4 *)(DST)) = *((const struct prefix_ipv4 *)(SRC)); extern int prefix_ipv4_any(const struct prefix_ipv4 *); @@ -380,15 +380,12 @@ static inline int is_default_prefix(const struct prefix *p) if (!p) return 0; - if ((p->family == AF_INET) && - (p->u.prefix4.s_addr == INADDR_ANY) && - (p->prefixlen == 0)) + if ((p->family == AF_INET) && (p->u.prefix4.s_addr == INADDR_ANY) + && (p->prefixlen == 0)) return 1; - if ((p->family == AF_INET6) && - (p->prefixlen == 0) && - (!memcmp(&p->u.prefix6, &in6addr_any, - sizeof(struct in6_addr)))) + if ((p->family == AF_INET6) && (p->prefixlen == 0) + && (!memcmp(&p->u.prefix6, &in6addr_any, sizeof(struct in6_addr)))) return 1; return 0; |
