diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-30 21:37:29 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-30 21:37:29 -0700 |
commit | 4e700bcdd89a5592a5a991bf3e78904de1140611 (patch) | |
tree | 1a21ea2eb4c0ebe1a9d5303c6cc8328474f7f5e1 /include/net/if_inet6.h | |
parent | Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip (diff) | |
parent | sctp: Pass __GFP_NOWARN to hash table allocation attempts. (diff) | |
download | linux-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.h | 16 |
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 |