summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyrus <cyrus@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-11-16 09:18:14 +0000
committercyrus <cyrus@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-11-16 09:18:14 +0000
commitf933d4c77b685bd7e72207f8a8198de88844cb4a (patch)
tree8327ebd94d6f162c21e797049983f4c2a3913f06
parent90cee0287c274be5174e1a072eb14016d47423e4 (diff)
6rd: Clear correct IPv6 address bits in 6rdcalc
The correct bits are now cleared in the IPv6 address as the shift value to the correct byte in the IPv6 address was wrong. Depending on the stack values this could result in a hanging 6rdcalc program due to an endless loop. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38818 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/network/ipv6/6rd/src/6rdcalc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/network/ipv6/6rd/src/6rdcalc.c b/package/network/ipv6/6rd/src/6rdcalc.c
index 56e07d255b..87bc397006 100644
--- a/package/network/ipv6/6rd/src/6rdcalc.c
+++ b/package/network/ipv6/6rd/src/6rdcalc.c
@@ -110,7 +110,7 @@ int main(int argc, const char **argv)
/* Clear remaining bits. */
while (v6it < 128) {
- byte6 = (unsigned char *)(&v6.s6_addr) + (v6it >> 2);
+ byte6 = (unsigned char *)(&v6.s6_addr) + (v6it >> 3);
bit6 = 128 >> (v6it & 0x07);
*byte6 &= ~bit6;