aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/if_inet6.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-30 21:37:29 -0700
committerDavid S. Miller <davem@davemloft.net>2011-03-30 21:37:29 -0700
commit4e700bcdd89a5592a5a991bf3e78904de1140611 (patch)
tree1a21ea2eb4c0ebe1a9d5303c6cc8328474f7f5e1 /include/net/if_inet6.h
parentMerge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip (diff)
parentsctp: Pass __GFP_NOWARN to hash table allocation attempts. (diff)
downloadlinux-dev-4e700bcdd89a5592a5a991bf3e78904de1140611.tar.xz
linux-dev-4e700bcdd89a5592a5a991bf3e78904de1140611.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
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