projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
14e570f
)
This should work much better.
author
Wessel Dankers
<wsl@tinc-vpn.org>
Fri, 7 Jun 2002 11:14:05 +0000
(11:14 +0000)
committer
Wessel Dankers
<wsl@tinc-vpn.org>
Fri, 7 Jun 2002 11:14:05 +0000
(11:14 +0000)
src/netutl.c
patch
|
blob
|
history
diff --git
a/src/netutl.c
b/src/netutl.c
index
29bcfc1
..
4d91bf4
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
6 2002/06/05 00:25:54 guus
Exp $
+ $Id: netutl.c,v 1.12.4.3
7 2002/06/07 11:14:05 wsl
Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-236,14
+236,13
@@
int maskcheck(char *a, int masklen, int len)
cp
i = masklen / 8;
masklen %= 8;
cp
i = masklen / 8;
masklen %= 8;
-
- if(masklen)
- if(a[i++] & (char)~(0x100 - (1 << masklen)))
- return -1;
-
+
+ if(a[i++] & (0xff >> masklen))
+ return -1;
+
for(; i < len; i++)
if(a[i] != 0)
for(; i < len; i++)
if(a[i] != 0)
- return -
1
;
+ return -
2
;
return 0;
}
return 0;
}