INN-CURRENT-20020322 bugs on BSD/OS 4.3

Antonio Querubin tony at lava.net
Fri Mar 22 18:20:35 UTC 2002


On Fri, 22 Mar 2002, Jeffrey M. Vinocur wrote:

> On Fri, 22 Mar 2002, The Doctor wrote:
>
> > perm.c: In function `MatchHost':=0D
> > perm.c:1680: syntax error before `bits8'=0D
>
> Russ, what's the right way to get uint8_t?

Attached is a patch where I've changed it to "unsigned char" since that's
already in use elsewhere in perm.c.  If there's a more universally
accepted or safer way to define this (eg. unsigned short int), let me
know.

The patch also contains an additional fix for handling IPv6 prefix lengths
that aren't multiples of 8.




-- Attached file included as plaintext by Ecartis --
-- File: perm.c.diff
-- Desc: perm.c diff in INN-CURRENT-20020322

--- nnrpd/perm.c.orig	Fri Mar 22 00:00:50 2002
+++ nnrpd/perm.c	Fri Mar 22 08:10:18 2002
@@ -1677,7 +1677,7 @@
 		struct in_addr ia, net, tmp;
 #ifdef HAVE_INET6
 		struct in6_addr ia6, net6;
-		uint8_t	bits8;
+		unsigned char bits8;
 #endif
 		unsigned int mask;
 
@@ -1710,7 +1710,7 @@
 			    ret = FALSE;
 			    break;
 			} else if ( (c+1)*8 > mask ) {
-			    for (bits8 = b = 0; b < mask && b < 8; b++)
+			    for (bits8 = b = 0; b < (mask % 8); b++)
 				bits8 |= (1 << (7 - b));
 			    if ((ia6.s6_addr[c] & bits8) !=
 			    	(net6.s6_addr[c] & bits8) ) {



More information about the inn-bugs mailing list