summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2017-03-20 14:07:29 +0200
committerRobert Mustacchi <rm@joyent.com>2017-03-28 23:59:18 +0000
commit714901a982d5d1bbb9fd9f5e46ddd7cacfcf9cdc (patch)
treeb2c380f91d4bc392b9c5ccd89287af9198a1792f /usr/src
parentce326879a41b052db3abafb44e551f9d9c40cdba (diff)
downloadillumos-gate-714901a982d5d1bbb9fd9f5e46ddd7cacfcf9cdc.tar.gz
7986 loader: remove network mask calculation for Classful network
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/boot/Makefile.version2
-rw-r--r--usr/src/boot/lib/libstand/bootp.c33
2 files changed, 11 insertions, 24 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version
index d5b5b2a149..0a3c013869 100644
--- a/usr/src/boot/Makefile.version
+++ b/usr/src/boot/Makefile.version
@@ -33,4 +33,4 @@ LOADER_VERSION = 1.1
# Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes.
# The version is processed from left to right, the version number can only
# be increased.
-BOOT_VERSION = $(LOADER_VERSION)-2017.3.20.1
+BOOT_VERSION = $(LOADER_VERSION)-2017.3.26.1
diff --git a/usr/src/boot/lib/libstand/bootp.c b/usr/src/boot/lib/libstand/bootp.c
index 53fbe566d2..d1d4378bab 100644
--- a/usr/src/boot/lib/libstand/bootp.c
+++ b/usr/src/boot/lib/libstand/bootp.c
@@ -63,8 +63,6 @@ __FBSDID("$FreeBSD$");
struct in_addr servip;
-static n_long nmask, smask;
-
static time_t bot;
static char vm_rfc1048[4] = VM_RFC1048;
@@ -222,30 +220,19 @@ bootp(int sock, int flag)
bcopy(rbuf.rbootp.bp_file, bootfile, sizeof(bootfile));
bootfile[sizeof(bootfile) - 1] = '\0';
- if (IN_CLASSA(ntohl(myip.s_addr)))
- nmask = htonl(IN_CLASSA_NET);
- else if (IN_CLASSB(ntohl(myip.s_addr)))
- nmask = htonl(IN_CLASSB_NET);
- else
- nmask = htonl(IN_CLASSC_NET);
-#ifdef BOOTP_DEBUG
- if (debug)
- printf("'native netmask' is %s\n", intoa(nmask));
-#endif
-
- /* Check subnet mask against net mask; toss if bogus */
- if ((nmask & smask) != nmask) {
+ if (!netmask) {
+ if (IN_CLASSA(ntohl(myip.s_addr)))
+ netmask = htonl(IN_CLASSA_NET);
+ else if (IN_CLASSB(ntohl(myip.s_addr)))
+ netmask = htonl(IN_CLASSB_NET);
+ else
+ netmask = htonl(IN_CLASSC_NET);
#ifdef BOOTP_DEBUG
if (debug)
- printf("subnet mask (%s) bad\n", intoa(smask));
+ printf("'native netmask' is %s\n", intoa(netmask));
#endif
- smask = 0;
}
- /* Get subnet (or natural net) mask */
- netmask = nmask;
- if (smask)
- netmask = smask;
#ifdef BOOTP_DEBUG
if (debug)
printf("mask: %s\n", intoa(netmask));
@@ -375,7 +362,7 @@ vend_rfc1048(u_char *cp, u_int len)
break;
if (tag == TAG_SUBNET_MASK) {
- bcopy(cp, &smask, sizeof(smask));
+ bcopy(cp, &netmask, sizeof(netmask));
}
if (tag == TAG_GATEWAY) {
bcopy(cp, &gateip.s_addr, sizeof(gateip.s_addr));
@@ -452,7 +439,7 @@ vend_cmu(u_char *cp)
vp = (struct cmu_vend *)cp;
if (vp->v_smask.s_addr != 0) {
- smask = vp->v_smask.s_addr;
+ netmask = vp->v_smask.s_addr;
}
if (vp->v_dgate.s_addr != 0) {
gateip = vp->v_dgate;