projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d8c2490
)
Fix maskcheck() and maskcmp().
author
Guus Sliepen
<guus@tinc-vpn.org>
Fri, 5 Apr 2002 09:11:38 +0000
(09:11 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Fri, 5 Apr 2002 09:11:38 +0000
(09:11 +0000)
src/netutl.c
patch
|
blob
|
history
diff --git
a/src/netutl.c
b/src/netutl.c
index
c59a34b
..
20d3809
100644
(file)
--- a/
src/netutl.c
+++ b/
src/netutl.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: netutl.c,v 1.12.4.3
3 2002/03/19 00:08:23
guus Exp $
+ $Id: netutl.c,v 1.12.4.3
4 2002/04/05 09:11:38
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-191,7
+191,7
@@
cp
return result;
if(m)
return result;
if(m)
- return (a[i] & (0x100 - (
m << 1))) - (b[i] & (0x100 - (m << 1
)));
+ return (a[i] & (0x100 - (
1 << (8 - m)))) - (b[i] & (0x100 - (1 << (8 - m)
)));
return 0;
}
return 0;
}
@@
-204,7
+204,7
@@
cp
masklen %= 8;
if(masklen)
masklen %= 8;
if(masklen)
- a[i++] &= (0x100 - (
masklen << 1
));
+ a[i++] &= (0x100 - (
1 << masklen
));
for(; i < len; i++)
a[i] = 0;
for(; i < len; i++)
a[i] = 0;
@@
-219,7
+219,7
@@
cp
if(m)
{
if(m)
{
- a[i] = b[i] & (0x100 - (
m << 1
));
+ a[i] = b[i] & (0x100 - (
1 << m
));
i++;
}
i++;
}
@@
-235,7
+235,7
@@
cp
masklen %= 8;
if(masklen)
masklen %= 8;
if(masklen)
- if(a[i++] &
~(0x100 - (masklen << 1
)))
+ if(a[i++] &
(char)~(0x100 - (1 << masklen
)))
return -1;
for(; i < len; i++)
return -1;
for(; i < len; i++)