From 2ead0fa6d766f6c846ff8053ee5dc6daf30dc0f1 Mon Sep 17 00:00:00 2001 From: Paul Saab Date: Wed, 20 Sep 2000 18:16:20 +0000 Subject: IN_CLASS*() macros assume host order and s_addr is network byte order, so we must convert them to host order. --- lib/libstand/bootp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libstand') diff --git a/lib/libstand/bootp.c b/lib/libstand/bootp.c index c440c982c54d..5ac38b35dbe1 100644 --- a/lib/libstand/bootp.c +++ b/lib/libstand/bootp.c @@ -201,9 +201,9 @@ bootp(sock, flag) bcopy(rbuf.rbootp.bp_file, bootfile, sizeof(bootfile)); bootfile[sizeof(bootfile) - 1] = '\0'; - if (IN_CLASSA(myip.s_addr)) + if (IN_CLASSA(ntohl(myip.s_addr))) nmask = htonl(IN_CLASSA_NET); - else if (IN_CLASSB(myip.s_addr)) + else if (IN_CLASSB(ntohl(myip.s_addr))) nmask = htonl(IN_CLASSB_NET); else nmask = htonl(IN_CLASSC_NET); -- cgit v1.3