diff options
author | shin <shin@FreeBSD.org> | 2000-03-03 11:13:12 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 2000-03-03 11:13:12 +0000 |
commit | 73d476cc6479c6344b1bd61ca4519254b46d544c (patch) | |
tree | d561c1b7b5d50f03f48de22a70eff74d82d43c59 /lib/libc | |
parent | 91b0fd96fd89837d8fb4bcf2d16d5dca2213c1a4 (diff) | |
download | FreeBSD-src-73d476cc6479c6344b1bd61ca4519254b46d544c.zip FreeBSD-src-73d476cc6479c6344b1bd61ca4519254b46d544c.tar.gz |
CMSG_XXX macros alignment fixes to follow RFC2292.
Approved by: jkh
Submitted by: Partly from tech@openbsd
Reviewed by: itojun
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/rthdr.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/libc/net/rthdr.c b/lib/libc/net/rthdr.c index ce2a33c..1f9d102 100644 --- a/lib/libc/net/rthdr.c +++ b/lib/libc/net/rthdr.c @@ -63,7 +63,9 @@ inet6_rthdr_init(bp, type) int type; { register struct cmsghdr *ch = (struct cmsghdr *)bp; - register struct ip6_rthdr *rthdr = (struct ip6_rthdr *)(ch + 1); + register struct ip6_rthdr *rthdr; + + rthdr = (struct ip6_rthdr *)CMSG_DATA(ch); ch->cmsg_level = IPPROTO_IPV6; ch->cmsg_type = IPV6_RTHDR; @@ -88,7 +90,9 @@ inet6_rthdr_add(cmsg, addr, flags) const struct in6_addr *addr; u_int flags; { - register struct ip6_rthdr *rthdr = (struct ip6_rthdr *)(cmsg + 1); + register struct ip6_rthdr *rthdr; + + rthdr = (struct ip6_rthdr *)CMSG_DATA(cmsg); switch(rthdr->ip6r_type) { case IPV6_RTHDR_TYPE_0: @@ -135,7 +139,9 @@ inet6_rthdr_lasthop(cmsg, flags) struct cmsghdr *cmsg; unsigned int flags; { - register struct ip6_rthdr *rthdr = (struct ip6_rthdr *)(cmsg + 1); + register struct ip6_rthdr *rthdr; + + rthdr = (struct ip6_rthdr *)CMSG_DATA(cmsg); switch(rthdr->ip6r_type) { case IPV6_RTHDR_TYPE_0: @@ -189,7 +195,9 @@ int inet6_rthdr_segments(cmsg) const struct cmsghdr *cmsg; { - register struct ip6_rthdr *rthdr = (struct ip6_rthdr *)(cmsg + 1); + register struct ip6_rthdr *rthdr; + + rthdr = (struct ip6_rthdr *)CMSG_DATA(cmsg); switch(rthdr->ip6r_type) { case IPV6_RTHDR_TYPE_0: @@ -221,7 +229,9 @@ inet6_rthdr_getaddr(cmsg, index) struct cmsghdr *cmsg; int index; { - register struct ip6_rthdr *rthdr = (struct ip6_rthdr *)(cmsg + 1); + register struct ip6_rthdr *rthdr; + + rthdr = (struct ip6_rthdr *)CMSG_DATA(cmsg); switch(rthdr->ip6r_type) { case IPV6_RTHDR_TYPE_0: @@ -260,7 +270,9 @@ inet6_rthdr_getflags(cmsg, index) const struct cmsghdr *cmsg; int index; { - register struct ip6_rthdr *rthdr = (struct ip6_rthdr *)(cmsg + 1); + register struct ip6_rthdr *rthdr; + + rthdr = (struct ip6_rthdr *)CMSG_DATA(cmsg); switch(rthdr->ip6r_type) { case IPV6_RTHDR_TYPE_0: |