summaryrefslogtreecommitdiffstats
path: root/include/net/if_inet6.h
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-04-20 21:47:07 -0300
committerGustavo F. Padovan <padovan@profusion.mobi>2011-04-20 21:47:07 -0300
commit828d7d7b19446bf5a40928da47955c575a454c75 (patch)
treefd006445c562749de9a07fe6e5363bab5d285a20 /include/net/if_inet6.h
parent26954c7f26068b6ced108806fdd39aee5cd54e6f (diff)
parent069f40fc07f6df3da325e7ea1698a0d6247983d5 (diff)
downloadlinux-stable-828d7d7b19446bf5a40928da47955c575a454c75.tar.gz
linux-stable-828d7d7b19446bf5a40928da47955c575a454c75.tar.bz2
linux-stable-828d7d7b19446bf5a40928da47955c575a454c75.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/padovan/bluetooth-2.6
Conflicts: net/bluetooth/l2cap_core.c net/bluetooth/l2cap_sock.c net/bluetooth/mgmt.c
Diffstat (limited to 'include/net/if_inet6.h')
-rw-r--r--include/net/if_inet6.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 04977eefb0ee..fccc2180c61b 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -286,5 +286,21 @@ static inline void ipv6_ib_mc_map(const struct in6_addr *addr,
buf[9] = broadcast[9];
memcpy(buf + 10, addr->s6_addr + 6, 10);
}
+
+static inline int ipv6_ipgre_mc_map(const struct in6_addr *addr,
+ const unsigned char *broadcast, char *buf)
+{
+ if ((broadcast[0] | broadcast[1] | broadcast[2] | broadcast[3]) != 0) {
+ memcpy(buf, broadcast, 4);
+ } else {
+ /* v4mapped? */
+ if ((addr->s6_addr32[0] | addr->s6_addr32[1] |
+ (addr->s6_addr32[2] ^ htonl(0x0000ffff))) != 0)
+ return -EINVAL;
+ memcpy(buf, &addr->s6_addr32[3], 4);
+ }
+ return 0;
+}
+
#endif
#endif