summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2013-11-16 09:18:14 +0000
committerSteven Barth <cyrus@openwrt.org>2013-11-16 09:18:14 +0000
commitb5a4fb1c95fd2738259456a6e1fd140db3698a21 (patch)
treef7bc959577e206464cedc4c0d383c1f7f12ff941
parente4eef7e6207078a4987b0e02d2ad4068083cf921 (diff)
downloadmtk-20170518-b5a4fb1c95fd2738259456a6e1fd140db3698a21.zip
mtk-20170518-b5a4fb1c95fd2738259456a6e1fd140db3698a21.tar.gz
mtk-20170518-b5a4fb1c95fd2738259456a6e1fd140db3698a21.tar.bz2
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> SVN-Revision: 38818
-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 56e07d2..87bc397 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;