diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2015-05-24 12:07:25 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-05-24 12:09:52 +0200 |
commit | a0189f32f7f986760ab9a5f9b6a71ff09d64c4bf (patch) | |
tree | 3f4c4538cb20960bd77b9dd8aa4ea4e71573c7c8 | |
parent | 29227e0caa5e095f6edb01dc2b7e43c74432dc9b (diff) | |
download | tdelibs-a0189f32f7f986760ab9a5f9b6a71ff09d64c4bf.tar.gz tdelibs-a0189f32f7f986760ab9a5f9b6a71ff09d64c4bf.zip |
Fix hang in TDENetMask::fromCIDRMask() due to point-to-point connections
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | tdecore/tdehw/tdenetworkconnections.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tdecore/tdehw/tdenetworkconnections.cpp b/tdecore/tdehw/tdenetworkconnections.cpp index 934c8f602..dec04e86b 100644 --- a/tdecore/tdehw/tdenetworkconnections.cpp +++ b/tdecore/tdehw/tdenetworkconnections.cpp @@ -99,7 +99,8 @@ void TDENetMask::fromCIDRMask(unsigned char mask, bool ipv6) { unsigned int internalMask = mask; if (!ipv6) { m_ipv4NetMask = 0; - for (i=31;i>=(32-internalMask);i--) { + for (i=32; i>(32-internalMask); ) { + i--; SET_BIT(m_ipv4NetMask, i); } m_isIPV6 = false; @@ -109,7 +110,8 @@ void TDENetMask::fromCIDRMask(unsigned char mask, bool ipv6) { j=0; unsigned int byteno=0; memset(maskarray.c, 0, 16); - for (i=127;i>=(128-internalMask);i--) { + for (i=128; i>(128-internalMask); ) { + i--; SET_BIT(maskarray.c[byteno], (i-((15-byteno)*8))); j++; if (j>7) { |