diff options
author | shin <shin@FreeBSD.org> | 2000-02-10 19:33:58 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 2000-02-10 19:33:58 +0000 |
commit | a0c9aca93ba39577e7f36147df6ca979625e77b1 (patch) | |
tree | d3a3edccf39eec56f4023db238559dd635269554 /sys/netinet6/icmp6.h | |
parent | e8fb8c14b5967d573ac36aa8c3a6fc4ac98543fb (diff) | |
download | FreeBSD-src-a0c9aca93ba39577e7f36147df6ca979625e77b1.zip FreeBSD-src-a0c9aca93ba39577e7f36147df6ca979625e77b1.tar.gz |
Forbid include of soem inet6 header files from wrong place
KAME put INET6 related stuff into sys/netinet6 dir, but IPv6
standard API(RFC2553) require following files to be under sys/netinet.
netinet/ip6.h
netinet/icmp6.h
Now those header files just include each following files.
netinet6/ip6.h
netinet6/icmp6.h
Also KAME has netinet6/in6.h for easy INET6 common defs
sharing between different BSDs, but RFC2553 requires only
netinet/in.h should be included from userland.
So netinet/in.h also includes netinet6/in6.h inside.
To keep apps portability, apps should not directly include
above files from netinet6 dir.
Ideally, all contents of,
netinet6/ip6.h
netinet6/icmp6.h
netinet6/in6.h
should be moved into
netinet/ip6.h
netinet/icmp6.h
netinet/in.h
but to avoid big changes in this stage, add some hack, that
-Put some special macro define into those files under neitnet
-Let files under netinet6 cause error if it is included
from some apps, and, if the specifal macro define is not
defined.
(which should have been defined if files under netinet is
included)
-And let them print an error message which tells the
correct name of the include file to be included.
Also fix apps which includes invalid header files.
Approved by: jkh
Obtained from: KAME project
Diffstat (limited to 'sys/netinet6/icmp6.h')
-rw-r--r-- | sys/netinet6/icmp6.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet6/icmp6.h b/sys/netinet6/icmp6.h index c67e961..feb664e 100644 --- a/sys/netinet6/icmp6.h +++ b/sys/netinet6/icmp6.h @@ -67,6 +67,10 @@ #ifndef _NETINET6_ICMPV6_H_ #define _NETINET6_ICMPV6_H_ +#if !defined(_KERNEL) && !defined(__KAME_NETINET_ICMP6_H_INCLUDED_) +#error "do not include netinet6/icmp6.h directly, include netinet/icmp6.h" +#endif + #define ICMPV6_PLD_MAXLEN 1232 /* IPV6_MMTU - sizeof(struct ip6_hdr) - sizeof(struct icmp6_hdr) */ |