aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/if_inet6.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/if_inet6.h')
-rw-r--r--include/net/if_inet6.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index f95ff8d9aa47..11cf373970a9 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -30,8 +30,6 @@
30#define IF_PREFIX_ONLINK 0x01 30#define IF_PREFIX_ONLINK 0x01
31#define IF_PREFIX_AUTOCONF 0x02 31#define IF_PREFIX_AUTOCONF 0x02
32 32
33#ifdef __KERNEL__
34
35enum { 33enum {
36 INET6_IFADDR_STATE_DAD, 34 INET6_IFADDR_STATE_DAD,
37 INET6_IFADDR_STATE_POSTDAD, 35 INET6_IFADDR_STATE_POSTDAD,
@@ -89,10 +87,11 @@ struct ip6_sf_socklist {
89struct ipv6_mc_socklist { 87struct ipv6_mc_socklist {
90 struct in6_addr addr; 88 struct in6_addr addr;
91 int ifindex; 89 int ifindex;
92 struct ipv6_mc_socklist *next; 90 struct ipv6_mc_socklist __rcu *next;
93 rwlock_t sflock; 91 rwlock_t sflock;
94 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 92 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
95 struct ip6_sf_socklist *sflist; 93 struct ip6_sf_socklist *sflist;
94 struct rcu_head rcu;
96}; 95};
97 96
98struct ip6_sf_list { 97struct ip6_sf_list {
@@ -155,8 +154,8 @@ struct ifacaddr6 {
155struct ipv6_devstat { 154struct ipv6_devstat {
156 struct proc_dir_entry *proc_dir_entry; 155 struct proc_dir_entry *proc_dir_entry;
157 DEFINE_SNMP_STAT(struct ipstats_mib, ipv6); 156 DEFINE_SNMP_STAT(struct ipstats_mib, ipv6);
158 DEFINE_SNMP_STAT(struct icmpv6_mib, icmpv6); 157 DEFINE_SNMP_STAT_ATOMIC(struct icmpv6_mib_device, icmpv6dev);
159 DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg); 158 DEFINE_SNMP_STAT_ATOMIC(struct icmpv6msg_mib_device, icmpv6msgdev);
160}; 159};
161 160
162struct inet6_dev { 161struct inet6_dev {
@@ -195,7 +194,7 @@ struct inet6_dev {
195 struct rcu_head rcu; 194 struct rcu_head rcu;
196}; 195};
197 196
198static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf) 197static inline void ipv6_eth_mc_map(const struct in6_addr *addr, char *buf)
199{ 198{
200 /* 199 /*
201 * +-------+-------+-------+-------+-------+-------+ 200 * +-------+-------+-------+-------+-------+-------+
@@ -209,7 +208,7 @@ static inline void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
209 memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32)); 208 memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32));
210} 209}
211 210
212static inline void ipv6_tr_mc_map(struct in6_addr *addr, char *buf) 211static inline void ipv6_tr_mc_map(const struct in6_addr *addr, char *buf)
213{ 212{
214 /* All nodes FF01::1, FF02::1, FF02::1:FFxx:xxxx */ 213 /* All nodes FF01::1, FF02::1, FF02::1:FFxx:xxxx */
215 214
@@ -285,5 +284,20 @@ static inline void ipv6_ib_mc_map(const struct in6_addr *addr,
285 buf[9] = broadcast[9]; 284 buf[9] = broadcast[9];
286 memcpy(buf + 10, addr->s6_addr + 6, 10); 285 memcpy(buf + 10, addr->s6_addr + 6, 10);
287} 286}
288#endif 287
288static inline int ipv6_ipgre_mc_map(const struct in6_addr *addr,
289 const unsigned char *broadcast, char *buf)
290{
291 if ((broadcast[0] | broadcast[1] | broadcast[2] | broadcast[3]) != 0) {
292 memcpy(buf, broadcast, 4);
293 } else {
294 /* v4mapped? */
295 if ((addr->s6_addr32[0] | addr->s6_addr32[1] |
296 (addr->s6_addr32[2] ^ htonl(0x0000ffff))) != 0)
297 return -EINVAL;
298 memcpy(buf, &addr->s6_addr32[3], 4);
299 }
300 return 0;
301}
302
289#endif 303#endif