projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af95368
)
Fix a bug in handling prefixlengths that are not a multiple of 4.
author
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 12 Apr 2006 08:38:35 +0000
(08:38 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 12 Apr 2006 08:38:35 +0000
(08:38 +0000)
Thanks to Sven-Haegar Koch for spotting the bug and providing the fix.
THANKS
patch
|
blob
|
history
src/netutl.c
patch
|
blob
|
history
diff --git
a/THANKS
b/THANKS
index 02cd090caab0f0fda24dac255421fac43caec765..21176e21089e4ba19c96921756c2f61d3da98113 100644
(file)
--- a/
THANKS
+++ b/
THANKS
@@
-24,6
+24,7
@@
We would like to thank the following people for their contributions to tinc:
* Paul Littlefield
* Robert van der Meulen
* Scott Lamb
+* Sven-Haegar Koch
* Teemu Kiviniemi
* Tonnerre Lombard
* Wessel Dankers
diff --git
a/src/netutl.c
b/src/netutl.c
index 535e370b9ab8fed061ac172fb2eab1d58b2489b1..d84262728ccbf24ec9fec7b72ffa570de1962984 100644
(file)
--- a/
src/netutl.c
+++ b/
src/netutl.c
@@
-257,7
+257,7
@@
void mask(void *va, int masklen, int len)
masklen %= 8;
if(masklen)
- a[i++] &= (0x100 - (1 <<
masklen
));
+ a[i++] &= (0x100 - (1 <<
(8 - masklen)
));
for(; i < len; i++)
a[i] = 0;
@@
-275,7
+275,7
@@
void maskcpy(void *va, const void *vb, int masklen, int len)
a[i] = b[i];
if(m) {
- a[i] = b[i] & (0x100 - (1 <<
m
));
+ a[i] = b[i] & (0x100 - (1 <<
(8 - m)
));
i++;
}