Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Apr 2009 11:07:39 -0400
From:      Coleman Kane <cokane@FreeBSD.org>
To:        Randall Stewart <rrs@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r190775 - head/sbin/route
Message-ID:  <1239030459.1946.4.camel@localhost>
In-Reply-To: <200904061427.n36ERTVF074015@svn.freebsd.org>
References:  <200904061427.n36ERTVF074015@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-ppb+PrdMf9zgXtHOMppw
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Mon, 2009-04-06 at 14:27 +0000, Randall Stewart wrote:
> Author: rrs
> Date: Mon Apr  6 14:27:28 2009
> New Revision: 190775
> URL: http://svn.freebsd.org/changeset/base/190775
>=20
> Log:
>   Ok, looking at the solution a bit closer, the level
>   calculation was too agressive. Instead we should only
>   look at each nibble. This makes it so we make
>   10.2.0.0 become 10.2/16 NOT 10.2/17.

I presume you meant "NOT 10.2/15" here? Correct me if I'm wrong, but
that's what I gathered by the discussion of "the bug" in the previous
thread.

>  =20
>   Need to explore the non-cidr address issue. The two
>   may not be seperable..
>  =20
>   MFC after:	1 week
>=20
> Modified:
>   head/sbin/route/route.c
>=20
> Modified: head/sbin/route/route.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sbin/route/route.c	Mon Apr  6 14:12:22 2009	(r190774)
> +++ head/sbin/route/route.c	Mon Apr  6 14:27:28 2009	(r190775)
> @@ -808,15 +808,15 @@ inet_makenetandmask(net, sin, bits)
>  	 * CIDR address.
>  	 */
>  	if ((bits =3D=3D 0)  && (addr !=3D 0)) {
> -		int i, j;
> -		for(i=3D0,j=3D1; i<32; i++)  {
> +		u_long i, j;
> +		for(i=3D0,j=3D0xff; i<4; i++)  {
>  			if (addr & j) {
>  				break;
>  			}
> -			j <<=3D 1;
> +			j <<=3D 8;
>  		}
>  		/* i holds the first non zero bit */
> -		bits =3D 32 - i;=09
> +		bits =3D 32 - (i*8);=09
>  	}
>  	mask =3D 0xffffffff << (32 - bits);
> =20

--=20
Coleman Kane

--=-ppb+PrdMf9zgXtHOMppw
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEABECAAYFAknaGrgACgkQcMSxQcXat5ciAwCfeyrBjKtTQBb9zKghtVf4kmQ0
ALEAnifpZqjeplB5uCE3Akq1bzBB20pe
=kPs7
-----END PGP SIGNATURE-----

--=-ppb+PrdMf9zgXtHOMppw--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1239030459.1946.4.camel>