diff options
author | abial <abial@FreeBSD.org> | 1998-10-09 12:42:20 +0000 |
---|---|---|
committer | abial <abial@FreeBSD.org> | 1998-10-09 12:42:20 +0000 |
commit | 12ff33ff94404e3a36b918594a09e6434ab11142 (patch) | |
tree | 7408adf0433293fa6bda52648fd65a855b6bb3de /release/picobsd/tinyware | |
parent | 918f35a74e867b71feeb432d0b25785e0da496dd (diff) | |
download | FreeBSD-src-12ff33ff94404e3a36b918594a09e6434ab11142.zip FreeBSD-src-12ff33ff94404e3a36b918594a09e6434ab11142.tar.gz |
Fix for bad calculation of netmask bits. I'm amazed it worked thus far...
Diffstat (limited to 'release/picobsd/tinyware')
-rw-r--r-- | release/picobsd/tinyware/ns/ns.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/release/picobsd/tinyware/ns/ns.c b/release/picobsd/tinyware/ns/ns.c index 7a28323..e8dd253 100644 --- a/release/picobsd/tinyware/ns/ns.c +++ b/release/picobsd/tinyware/ns/ns.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ns.c,v 1.3 1998/09/02 13:11:23 abial Exp $ + * $Id: ns.c,v 1.4 1998/09/07 06:41:14 abial Exp $ */ @@ -99,10 +99,13 @@ sock_ntop(const struct sockaddr *sa, size_t salen) switch (sa->sa_family) { case 255: { struct sockaddr_in *sin = (struct sockaddr_in *) sa; + u_long mask; int i; i=0; - while(sin->sin_addr.s_addr & (0x800000>>i)) i++; + mask=ntohl(sin->sin_addr.s_addr); + + while(mask & (0x80000000>>i)) i++; sprintf(str,"/%d",i); return(str); } |