summaryrefslogtreecommitdiff
path: root/include/sparse/netinet/in.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sparse/netinet/in.h')
-rw-r--r--include/sparse/netinet/in.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/sparse/netinet/in.h b/include/sparse/netinet/in.h
index 83ad2cc58..f3ce8b9ca 100644
--- a/include/sparse/netinet/in.h
+++ b/include/sparse/netinet/in.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2011, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -99,6 +99,20 @@ struct sockaddr_in6 {
#define INADDR_LOOPBACK 0x7f000001
#define INADDR_NONE 0xffffffff
+#define IN6_IS_ADDR_V4MAPPED(X) \
+ ((X)->s6_addr[0] == 0 && \
+ (X)->s6_addr[1] == 0 && \
+ (X)->s6_addr[2] == 0 && \
+ (X)->s6_addr[3] == 0 && \
+ (X)->s6_addr[4] == 0 && \
+ (X)->s6_addr[5] == 0 && \
+ (X)->s6_addr[6] == 0 && \
+ (X)->s6_addr[7] == 0 && \
+ (X)->s6_addr[8] == 0 && \
+ (X)->s6_addr[9] == 0 && \
+ (X)->s6_addr[10] == 0xff && \
+ (X)->s6_addr[11] == 0xff)
+
#define INET6_ADDRSTRLEN 46
#define IPV6_TCLASS 67