diff options
author | David S. Miller <davem@davemloft.net> | 2008-04-12 22:19:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-12 22:19:46 -0400 |
commit | 6fb9114e4bc4b9144306bc2c64abd18b364409d7 (patch) | |
tree | a9e58416c5f77cd0764331ba81833f2313e07bb7 /include/net | |
parent | 03e1ad7b5d871d4189b1da3125c2f12d1b5f7d0b (diff) | |
parent | 05f175cdcf9d3615c1633615d87891ebfb729401 (diff) |
Merge branch 'net-2.6.26-misc-20080412b' of git://git.linux-ipv6.org/gitroot/yoshfuji/linux-2.6-dev
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/addrconf.h | 87 | ||||
-rw-r--r-- | include/net/ip6_route.h | 6 | ||||
-rw-r--r-- | include/net/ipv6.h | 26 | ||||
-rw-r--r-- | include/net/mip6.h | 3 | ||||
-rw-r--r-- | include/net/ndisc.h | 14 |
5 files changed, 44 insertions, 92 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index bdcc863a60a4..0a2f0372df31 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -76,12 +76,12 @@ extern int ipv6_chk_prefix(struct in6_addr *addr, | |||
76 | struct net_device *dev); | 76 | struct net_device *dev); |
77 | 77 | ||
78 | extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, | 78 | extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, |
79 | struct in6_addr *addr, | 79 | const struct in6_addr *addr, |
80 | struct net_device *dev, | 80 | struct net_device *dev, |
81 | int strict); | 81 | int strict); |
82 | 82 | ||
83 | extern int ipv6_dev_get_saddr(struct net_device *dev, | 83 | extern int ipv6_dev_get_saddr(struct net_device *dev, |
84 | struct in6_addr *daddr, | 84 | const struct in6_addr *daddr, |
85 | unsigned int srcprefs, | 85 | unsigned int srcprefs, |
86 | struct in6_addr *saddr); | 86 | struct in6_addr *saddr); |
87 | extern int ipv6_get_lladdr(struct net_device *dev, | 87 | extern int ipv6_get_lladdr(struct net_device *dev, |
@@ -105,25 +105,27 @@ extern u32 ipv6_addr_label(const struct in6_addr *addr, | |||
105 | /* | 105 | /* |
106 | * multicast prototypes (mcast.c) | 106 | * multicast prototypes (mcast.c) |
107 | */ | 107 | */ |
108 | extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, | 108 | extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, |
109 | struct in6_addr *addr); | 109 | const struct in6_addr *addr); |
110 | extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, | 110 | extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, |
111 | struct in6_addr *addr); | 111 | const struct in6_addr *addr); |
112 | extern void ipv6_sock_mc_close(struct sock *sk); | 112 | extern void ipv6_sock_mc_close(struct sock *sk); |
113 | extern int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, | 113 | extern int inet6_mc_check(struct sock *sk, |
114 | struct in6_addr *src_addr); | 114 | const struct in6_addr *mc_addr, |
115 | const struct in6_addr *src_addr); | ||
115 | 116 | ||
116 | extern int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr); | 117 | extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); |
117 | extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr); | 118 | extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); |
118 | extern int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr); | 119 | extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); |
119 | extern void ipv6_mc_up(struct inet6_dev *idev); | 120 | extern void ipv6_mc_up(struct inet6_dev *idev); |
120 | extern void ipv6_mc_down(struct inet6_dev *idev); | 121 | extern void ipv6_mc_down(struct inet6_dev *idev); |
121 | extern void ipv6_mc_init_dev(struct inet6_dev *idev); | 122 | extern void ipv6_mc_init_dev(struct inet6_dev *idev); |
122 | extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); | 123 | extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); |
123 | extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); | 124 | extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); |
124 | 125 | ||
125 | extern int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, | 126 | extern int ipv6_chk_mcast_addr(struct net_device *dev, |
126 | struct in6_addr *src_addr); | 127 | const struct in6_addr *group, |
128 | const struct in6_addr *src_addr); | ||
127 | extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr); | 129 | extern int ipv6_is_mld(struct sk_buff *skb, int nexthdr); |
128 | 130 | ||
129 | extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); | 131 | extern void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len); |
@@ -189,25 +191,6 @@ static inline void in6_ifa_put(struct inet6_ifaddr *ifp) | |||
189 | #define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt) | 191 | #define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt) |
190 | 192 | ||
191 | 193 | ||
192 | /* | ||
193 | * Hash function taken from net_alias.c | ||
194 | */ | ||
195 | |||
196 | static __inline__ u8 ipv6_addr_hash(const struct in6_addr *addr) | ||
197 | { | ||
198 | __u32 word; | ||
199 | |||
200 | /* | ||
201 | * We perform the hash function over the last 64 bits of the address | ||
202 | * This will include the IEEE address token on links that support it. | ||
203 | */ | ||
204 | |||
205 | word = (__force u32)(addr->s6_addr32[2] ^ addr->s6_addr32[3]); | ||
206 | word ^= (word >> 16); | ||
207 | word ^= (word >> 8); | ||
208 | |||
209 | return ((word ^ (word >> 4)) & 0x0f); | ||
210 | } | ||
211 | 194 | ||
212 | /* | 195 | /* |
213 | * compute link-local solicited-node multicast address | 196 | * compute link-local solicited-node multicast address |
@@ -222,17 +205,6 @@ static inline void addrconf_addr_solict_mult(const struct in6_addr *addr, | |||
222 | htonl(0xFF000000) | addr->s6_addr32[3]); | 205 | htonl(0xFF000000) | addr->s6_addr32[3]); |
223 | } | 206 | } |
224 | 207 | ||
225 | |||
226 | static inline void ipv6_addr_all_nodes(struct in6_addr *addr) | ||
227 | { | ||
228 | ipv6_addr_set(addr, htonl(0xFF020000), 0, 0, htonl(0x1)); | ||
229 | } | ||
230 | |||
231 | static inline void ipv6_addr_all_routers(struct in6_addr *addr) | ||
232 | { | ||
233 | ipv6_addr_set(addr, htonl(0xFF020000), 0, 0, htonl(0x2)); | ||
234 | } | ||
235 | |||
236 | static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) | 208 | static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) |
237 | { | 209 | { |
238 | return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000); | 210 | return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000); |
@@ -240,34 +212,19 @@ static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) | |||
240 | 212 | ||
241 | static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) | 213 | static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) |
242 | { | 214 | { |
243 | return (addr->s6_addr32[0] == htonl(0xff020000) && | 215 | return (((addr->s6_addr32[0] ^ htonl(0xff020000)) | |
244 | addr->s6_addr32[1] == 0 && | 216 | addr->s6_addr32[1] | addr->s6_addr32[2] | |
245 | addr->s6_addr32[2] == 0 && | 217 | (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0); |
246 | addr->s6_addr32[3] == htonl(0x00000001)); | ||
247 | } | 218 | } |
248 | 219 | ||
249 | static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) | 220 | static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) |
250 | { | 221 | { |
251 | return (addr->s6_addr32[0] == htonl(0xff020000) && | 222 | return (((addr->s6_addr32[0] ^ htonl(0xff020000)) | |
252 | addr->s6_addr32[1] == 0 && | 223 | addr->s6_addr32[1] | addr->s6_addr32[2] | |
253 | addr->s6_addr32[2] == 0 && | 224 | (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0); |
254 | addr->s6_addr32[3] == htonl(0x00000002)); | ||
255 | } | 225 | } |
256 | 226 | ||
257 | static inline int ipv6_isatap_eui64(u8 *eui, __be32 addr) | 227 | extern int __ipv6_isatap_ifid(u8 *eui, __be32 addr); |
258 | { | ||
259 | eui[0] = (ipv4_is_zeronet(addr) || ipv4_is_private_10(addr) || | ||
260 | ipv4_is_loopback(addr) || ipv4_is_linklocal_169(addr) || | ||
261 | ipv4_is_private_172(addr) || ipv4_is_test_192(addr) || | ||
262 | ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) || | ||
263 | ipv4_is_test_198(addr) || ipv4_is_multicast(addr) || | ||
264 | ipv4_is_lbcast(addr)) ? 0x00 : 0x02; | ||
265 | eui[1] = 0; | ||
266 | eui[2] = 0x5E; | ||
267 | eui[3] = 0xFE; | ||
268 | memcpy (eui+4, &addr, 4); | ||
269 | return 0; | ||
270 | } | ||
271 | 228 | ||
272 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) | 229 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) |
273 | { | 230 | { |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 9080076ce0e5..9313491e3dad 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -61,13 +61,13 @@ extern int ip6_ins_rt(struct rt6_info *); | |||
61 | extern int ip6_del_rt(struct rt6_info *); | 61 | extern int ip6_del_rt(struct rt6_info *); |
62 | 62 | ||
63 | extern struct rt6_info *rt6_lookup(struct net *net, | 63 | extern struct rt6_info *rt6_lookup(struct net *net, |
64 | struct in6_addr *daddr, | 64 | const struct in6_addr *daddr, |
65 | struct in6_addr *saddr, | 65 | const struct in6_addr *saddr, |
66 | int oif, int flags); | 66 | int oif, int flags); |
67 | 67 | ||
68 | extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, | 68 | extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, |
69 | struct neighbour *neigh, | 69 | struct neighbour *neigh, |
70 | struct in6_addr *addr); | 70 | const struct in6_addr *addr); |
71 | extern int icmp6_dst_gc(int *more); | 71 | extern int icmp6_dst_gc(int *more); |
72 | 72 | ||
73 | extern void fib6_force_start_gc(struct net *net); | 73 | extern void fib6_force_start_gc(struct net *net); |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 5738c1c73ac1..49c48983019f 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -280,12 +280,10 @@ static inline int | |||
280 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | 280 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, |
281 | const struct in6_addr *a2) | 281 | const struct in6_addr *a2) |
282 | { | 282 | { |
283 | unsigned int i; | 283 | return (!!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) | |
284 | 284 | ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) | | |
285 | for (i = 0; i < 4; i++) | 285 | ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) | |
286 | if ((a1->s6_addr32[i] ^ a2->s6_addr32[i]) & m->s6_addr32[i]) | 286 | ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]))); |
287 | return 1; | ||
288 | return 0; | ||
289 | } | 287 | } |
290 | 288 | ||
291 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | 289 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) |
@@ -320,10 +318,10 @@ static inline void ipv6_addr_set(struct in6_addr *addr, | |||
320 | static inline int ipv6_addr_equal(const struct in6_addr *a1, | 318 | static inline int ipv6_addr_equal(const struct in6_addr *a1, |
321 | const struct in6_addr *a2) | 319 | const struct in6_addr *a2) |
322 | { | 320 | { |
323 | return (a1->s6_addr32[0] == a2->s6_addr32[0] && | 321 | return (((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | |
324 | a1->s6_addr32[1] == a2->s6_addr32[1] && | 322 | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | |
325 | a1->s6_addr32[2] == a2->s6_addr32[2] && | 323 | (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | |
326 | a1->s6_addr32[3] == a2->s6_addr32[3]); | 324 | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0); |
327 | } | 325 | } |
328 | 326 | ||
329 | static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | 327 | static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, |
@@ -371,8 +369,8 @@ static inline int ipv6_addr_any(const struct in6_addr *a) | |||
371 | 369 | ||
372 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | 370 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) |
373 | { | 371 | { |
374 | return ((a->s6_addr32[0] | a->s6_addr32[1]) == 0 && | 372 | return ((a->s6_addr32[0] | a->s6_addr32[1] | |
375 | a->s6_addr32[2] == htonl(0x0000ffff)); | 373 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0); |
376 | } | 374 | } |
377 | 375 | ||
378 | /* | 376 | /* |
@@ -453,8 +451,8 @@ extern int ip6_xmit(struct sock *sk, | |||
453 | extern int ip6_nd_hdr(struct sock *sk, | 451 | extern int ip6_nd_hdr(struct sock *sk, |
454 | struct sk_buff *skb, | 452 | struct sk_buff *skb, |
455 | struct net_device *dev, | 453 | struct net_device *dev, |
456 | struct in6_addr *saddr, | 454 | const struct in6_addr *saddr, |
457 | struct in6_addr *daddr, | 455 | const struct in6_addr *daddr, |
458 | int proto, int len); | 456 | int proto, int len); |
459 | 457 | ||
460 | extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); | 458 | extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); |
diff --git a/include/net/mip6.h b/include/net/mip6.h index 63272610a24a..a83ad1982a90 100644 --- a/include/net/mip6.h +++ b/include/net/mip6.h | |||
@@ -28,9 +28,6 @@ | |||
28 | #include <linux/skbuff.h> | 28 | #include <linux/skbuff.h> |
29 | #include <net/sock.h> | 29 | #include <net/sock.h> |
30 | 30 | ||
31 | #define MIP6_OPT_PAD_1 0 | ||
32 | #define MIP6_OPT_PAD_N 1 | ||
33 | |||
34 | /* | 31 | /* |
35 | * Mobility Header | 32 | * Mobility Header |
36 | */ | 33 | */ |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 16424236fe2f..9c451ff2f4f4 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -94,17 +94,17 @@ extern int ndisc_rcv(struct sk_buff *skb); | |||
94 | 94 | ||
95 | extern void ndisc_send_ns(struct net_device *dev, | 95 | extern void ndisc_send_ns(struct net_device *dev, |
96 | struct neighbour *neigh, | 96 | struct neighbour *neigh, |
97 | struct in6_addr *solicit, | 97 | const struct in6_addr *solicit, |
98 | struct in6_addr *daddr, | 98 | const struct in6_addr *daddr, |
99 | struct in6_addr *saddr); | 99 | const struct in6_addr *saddr); |
100 | 100 | ||
101 | extern void ndisc_send_rs(struct net_device *dev, | 101 | extern void ndisc_send_rs(struct net_device *dev, |
102 | struct in6_addr *saddr, | 102 | const struct in6_addr *saddr, |
103 | struct in6_addr *daddr); | 103 | const struct in6_addr *daddr); |
104 | 104 | ||
105 | extern void ndisc_send_redirect(struct sk_buff *skb, | 105 | extern void ndisc_send_redirect(struct sk_buff *skb, |
106 | struct neighbour *neigh, | 106 | struct neighbour *neigh, |
107 | struct in6_addr *target); | 107 | const struct in6_addr *target); |
108 | 108 | ||
109 | extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); | 109 | extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); |
110 | 110 | ||
@@ -134,7 +134,7 @@ extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, | |||
134 | extern void inet6_ifinfo_notify(int event, | 134 | extern void inet6_ifinfo_notify(int event, |
135 | struct inet6_dev *idev); | 135 | struct inet6_dev *idev); |
136 | 136 | ||
137 | static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, struct in6_addr *addr) | 137 | static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr) |
138 | { | 138 | { |
139 | 139 | ||
140 | if (dev) | 140 | if (dev) |