diff options
author | ps <ps@FreeBSD.org> | 2000-09-20 18:16:20 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2000-09-20 18:16:20 +0000 |
commit | a51e07d64048125631138e980c90d907fe80042b (patch) | |
tree | e585b2457388ef193aa93af754e0dcc85eef19a9 /lib | |
parent | 006298df30acb5db4b4b361fadeb567d2381fcb7 (diff) | |
download | FreeBSD-src-a51e07d64048125631138e980c90d907fe80042b.zip FreeBSD-src-a51e07d64048125631138e980c90d907fe80042b.tar.gz |
IN_CLASS*() macros assume host order and s_addr is network byte
order, so we must convert them to host order.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libstand/bootp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libstand/bootp.c b/lib/libstand/bootp.c index c440c98..5ac38b3 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); |