aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index e4170a22fc6f..aecf88436abf 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -113,7 +113,6 @@ struct frag_hdr {
113 113
114/* sysctls */ 114/* sysctls */
115extern int sysctl_mld_max_msf; 115extern int sysctl_mld_max_msf;
116extern struct ctl_path net_ipv6_ctl_path[];
117 116
118#define _DEVINC(net, statname, modifier, idev, field) \ 117#define _DEVINC(net, statname, modifier, idev, field) \
119({ \ 118({ \
@@ -264,7 +263,7 @@ extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_t
264struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space, 263struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
265 struct ipv6_txoptions *opt); 264 struct ipv6_txoptions *opt);
266 265
267extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb); 266extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb);
268 267
269int ip6_frag_nqueues(struct net *net); 268int ip6_frag_nqueues(struct net *net);
270int ip6_frag_mem(struct net *net); 269int ip6_frag_mem(struct net *net);
@@ -333,8 +332,8 @@ static inline void ipv6_addr_set(struct in6_addr *addr,
333 addr->s6_addr32[3] = w4; 332 addr->s6_addr32[3] = w4;
334} 333}
335 334
336static inline int ipv6_addr_equal(const struct in6_addr *a1, 335static inline bool ipv6_addr_equal(const struct in6_addr *a1,
337 const struct in6_addr *a2) 336 const struct in6_addr *a2)
338{ 337{
339 return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | 338 return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) |
340 (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | 339 (a1->s6_addr32[1] ^ a2->s6_addr32[1]) |
@@ -342,27 +341,27 @@ static inline int ipv6_addr_equal(const struct in6_addr *a1,
342 (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0; 341 (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0;
343} 342}
344 343
345static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, 344static inline bool __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2,
346 unsigned int prefixlen) 345 unsigned int prefixlen)
347{ 346{
348 unsigned pdw, pbi; 347 unsigned int pdw, pbi;
349 348
350 /* check complete u32 in prefix */ 349 /* check complete u32 in prefix */
351 pdw = prefixlen >> 5; 350 pdw = prefixlen >> 5;
352 if (pdw && memcmp(a1, a2, pdw << 2)) 351 if (pdw && memcmp(a1, a2, pdw << 2))
353 return 0; 352 return false;
354 353
355 /* check incomplete u32 in prefix */ 354 /* check incomplete u32 in prefix */
356 pbi = prefixlen & 0x1f; 355 pbi = prefixlen & 0x1f;
357 if (pbi && ((a1[pdw] ^ a2[pdw]) & htonl((0xffffffff) << (32 - pbi)))) 356 if (pbi && ((a1[pdw] ^ a2[pdw]) & htonl((0xffffffff) << (32 - pbi))))
358 return 0; 357 return false;
359 358
360 return 1; 359 return true;
361} 360}
362 361
363static inline int ipv6_prefix_equal(const struct in6_addr *a1, 362static inline bool ipv6_prefix_equal(const struct in6_addr *a1,
364 const struct in6_addr *a2, 363 const struct in6_addr *a2,
365 unsigned int prefixlen) 364 unsigned int prefixlen)
366{ 365{
367 return __ipv6_prefix_equal(a1->s6_addr32, a2->s6_addr32, 366 return __ipv6_prefix_equal(a1->s6_addr32, a2->s6_addr32,
368 prefixlen); 367 prefixlen);
@@ -388,21 +387,21 @@ struct ip6_create_arg {
388}; 387};
389 388
390void ip6_frag_init(struct inet_frag_queue *q, void *a); 389void ip6_frag_init(struct inet_frag_queue *q, void *a);
391int ip6_frag_match(struct inet_frag_queue *q, void *a); 390bool ip6_frag_match(struct inet_frag_queue *q, void *a);
392 391
393static inline int ipv6_addr_any(const struct in6_addr *a) 392static inline bool ipv6_addr_any(const struct in6_addr *a)
394{ 393{
395 return (a->s6_addr32[0] | a->s6_addr32[1] | 394 return (a->s6_addr32[0] | a->s6_addr32[1] |
396 a->s6_addr32[2] | a->s6_addr32[3]) == 0; 395 a->s6_addr32[2] | a->s6_addr32[3]) == 0;
397} 396}
398 397
399static inline int ipv6_addr_loopback(const struct in6_addr *a) 398static inline bool ipv6_addr_loopback(const struct in6_addr *a)
400{ 399{
401 return (a->s6_addr32[0] | a->s6_addr32[1] | 400 return (a->s6_addr32[0] | a->s6_addr32[1] |
402 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0; 401 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0;
403} 402}
404 403
405static inline int ipv6_addr_v4mapped(const struct in6_addr *a) 404static inline bool ipv6_addr_v4mapped(const struct in6_addr *a)
406{ 405{
407 return (a->s6_addr32[0] | a->s6_addr32[1] | 406 return (a->s6_addr32[0] | a->s6_addr32[1] |
408 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0; 407 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0;
@@ -412,7 +411,7 @@ static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
412 * Check for a RFC 4843 ORCHID address 411 * Check for a RFC 4843 ORCHID address
413 * (Overlay Routable Cryptographic Hash Identifiers) 412 * (Overlay Routable Cryptographic Hash Identifiers)
414 */ 413 */
415static inline int ipv6_addr_orchid(const struct in6_addr *a) 414static inline bool ipv6_addr_orchid(const struct in6_addr *a)
416{ 415{
417 return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010); 416 return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010);
418} 417}
@@ -560,7 +559,7 @@ extern void ipv6_push_frag_opts(struct sk_buff *skb,
560extern int ipv6_skip_exthdr(const struct sk_buff *, int start, 559extern int ipv6_skip_exthdr(const struct sk_buff *, int start,
561 u8 *nexthdrp, __be16 *frag_offp); 560 u8 *nexthdrp, __be16 *frag_offp);
562 561
563extern int ipv6_ext_hdr(u8 nexthdr); 562extern bool ipv6_ext_hdr(u8 nexthdr);
564 563
565extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); 564extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);
566 565
@@ -661,8 +660,6 @@ extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
661extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); 660extern struct ctl_table *ipv6_route_sysctl_init(struct net *net);
662extern int ipv6_sysctl_register(void); 661extern int ipv6_sysctl_register(void);
663extern void ipv6_sysctl_unregister(void); 662extern void ipv6_sysctl_unregister(void);
664extern int ipv6_static_sysctl_register(void);
665extern void ipv6_static_sysctl_unregister(void);
666#endif 663#endif
667 664
668#endif /* _NET_IPV6_H */ 665#endif /* _NET_IPV6_H */