summaryrefslogtreecommitdiff
path: root/slirp/ip6.h
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/ip6.h')
-rw-r--r--slirp/ip6.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/slirp/ip6.h b/slirp/ip6.h
index 8ddfa242c4..0908855f0f 100644
--- a/slirp/ip6.h
+++ b/slirp/ip6.h
@@ -3,8 +3,8 @@
* Guillaume Subiron, Yann Bordenave, Serigne Modou Wagne.
*/
-#ifndef SLIRP_IP6_H_
-#define SLIRP_IP6_H_
+#ifndef SLIRP_IP6_H
+#define SLIRP_IP6_H
#include "net/eth.h"
@@ -26,6 +26,12 @@
0x00, 0x00, 0x00, 0x00,\
0x00, 0x00, 0x00, 0x02 } }
+#define ZERO_ADDR { .s6_addr = \
+ { 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00 } }
+
static inline bool in6_equal(const struct in6_addr *a, const struct in6_addr *b)
{
return memcmp(a, b, sizeof(*a)) == 0;
@@ -84,6 +90,9 @@ static inline bool in6_equal_mach(const struct in6_addr *a,
#define in6_solicitednode_multicast(a)\
(in6_equal_net(a, &(struct in6_addr)SOLICITED_NODE_PREFIX, 104))
+#define in6_zero(a)\
+ (in6_equal(a, &(struct in6_addr)ZERO_ADDR))
+
/* Compute emulated host MAC address from its ipv6 address */
static inline void in6_compute_ethaddr(struct in6_addr ip,
uint8_t eth[ETH_ALEN])