summaryrefslogtreecommitdiff
path: root/include/sparse
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>2015-07-01 16:12:11 -0300
committerBen Pfaff <blp@nicira.com>2015-07-01 16:49:40 -0700
commit964a4d5fd542b7dd4a6fb97fdc8d2a3c6ed41fde (patch)
tree11b183163c75228680f218f00f82d48c8a4d610d /include/sparse
parentd30fa82cd4211d66bab248370d84da803f181e44 (diff)
downloadopenvswitch-964a4d5fd542b7dd4a6fb97fdc8d2a3c6ed41fde.tar.gz
mcast-snooping: Use IPv6 address for MDB
Use IPv6 internally for storing multicast addresses. IPv4 addresses are translated to their IPv4-mapped equivalent. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com> Cc: Flavio Leitner <fbl@redhat.com> Cc: Ben Pfaff <blp@nicira.com> [blp@nicira.com added a "sparse" implementation of IN6_IS_ADDR_V4MAPPED.] Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include/sparse')
-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