summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2005-10-10 10:36:45 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2005-10-10 10:36:45 +0000
commit4e570829e6821445b4a003ffb289154bef80d7dc (patch)
tree52082f198438320745007fc76cca6dd5b6649d06 /lib/libc
parent07e6c8dd9cb19525870df18f5a2c94065ccefaba (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/rthdr.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/net/rthdr.c b/lib/libc/net/rthdr.c
index faad18ef852c..5fbb4bb43616 100644
--- a/lib/libc/net/rthdr.c
+++ b/lib/libc/net/rthdr.c
@@ -417,19 +417,18 @@ inet6_rth_getaddr(const void *bp, int idx)
{
struct ip6_rthdr *rh = (struct ip6_rthdr *)bp;
struct ip6_rthdr0 *rh0;
- int rthlen, addrs;
+ int addrs;
switch (rh->ip6r_type) {
case IPV6_RTHDR_TYPE_0:
rh0 = (struct ip6_rthdr0 *)bp;
- rthlen = (rh0->ip6r0_len + 1) << 3;
/*
* Validation for a type-0 routing header.
* Is this too strict?
*/
- if ((rthlen % 2) != 0 ||
- (addrs = (rthlen >> 1)) < rh0->ip6r0_segleft)
+ if ((rh0->ip6r0_len % 2) != 0 ||
+ (addrs = (rh0->ip6r0_len >> 1)) < rh0->ip6r0_segleft)
return (NULL);
if (idx < 0 || addrs <= idx)