summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/boot/lib/libstand/bootp.c16
-rw-r--r--usr/src/boot/lib/libstand/bootp.h1
-rw-r--r--usr/src/boot/lib/libstand/globals.c2
-rw-r--r--usr/src/boot/lib/libstand/net.h11
-rw-r--r--usr/src/boot/lib/libstand/nfs.c6
-rw-r--r--usr/src/boot/lib/libstand/tftp.c3
-rw-r--r--usr/src/boot/sys/boot/common/dev_net.c17
-rw-r--r--usr/src/boot/sys/boot/efi/loader/conf.c1
-rw-r--r--usr/src/boot/sys/boot/i386/libi386/Makefile3
-rw-r--r--usr/src/boot/sys/boot/i386/libi386/pxe.c37
-rw-r--r--usr/src/boot/sys/boot/i386/loader/Makefile2
-rw-r--r--usr/src/boot/sys/boot/i386/loader/conf.c12
-rw-r--r--usr/src/lib/libdladm/common/libdladm.c19
-rw-r--r--usr/src/man/man1m/dladm.1m10
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_vnops.c2
15 files changed, 96 insertions, 46 deletions
diff --git a/usr/src/boot/lib/libstand/bootp.c b/usr/src/boot/lib/libstand/bootp.c
index 7f9e62e76e..53fbe566d2 100644
--- a/usr/src/boot/lib/libstand/bootp.c
+++ b/usr/src/boot/lib/libstand/bootp.c
@@ -147,7 +147,17 @@ bootp(int sock, int flag)
bp->bp_vend[7] = TAG_CLASSID;
bp->bp_vend[8] = 9;
bcopy("PXEClient", &bp->bp_vend[9], 9);
- bp->bp_vend[18] = TAG_END;
+ bp->bp_vend[18] = TAG_PARAM_REQ;
+ bp->bp_vend[19] = 8;
+ bp->bp_vend[20] = TAG_ROOTPATH;
+ bp->bp_vend[21] = TAG_TFTP_SERVER;
+ bp->bp_vend[22] = TAG_HOSTNAME;
+ bp->bp_vend[23] = TAG_SWAPSERVER;
+ bp->bp_vend[24] = TAG_GATEWAY;
+ bp->bp_vend[25] = TAG_SUBNET_MASK;
+ bp->bp_vend[26] = TAG_INTF_MTU;
+ bp->bp_vend[27] = TAG_SERVERID;
+ bp->bp_vend[28] = TAG_END;
} else
bp->bp_vend[7] = TAG_END;
#else
@@ -419,6 +429,10 @@ vend_rfc1048(u_char *cp, u_int len)
bcopy(cp, &dhcp_serverip.s_addr,
sizeof(dhcp_serverip.s_addr));
}
+ if (tag == TAG_TFTP_SERVER) {
+ bcopy(cp, &tftpip.s_addr,
+ sizeof(tftpip.s_addr));
+ }
#endif
cp += size;
}
diff --git a/usr/src/boot/lib/libstand/bootp.h b/usr/src/boot/lib/libstand/bootp.h
index f1de2a1df8..bdafefd8d2 100644
--- a/usr/src/boot/lib/libstand/bootp.h
+++ b/usr/src/boot/lib/libstand/bootp.h
@@ -106,6 +106,7 @@ struct bootp {
#define TAG_T2 ((unsigned char) 59)
#define TAG_CLASSID ((unsigned char) 60)
#define TAG_CLIENTID ((unsigned char) 61)
+#define TAG_TFTP_SERVER ((unsigned char) 150)
#endif
#define TAG_END ((unsigned char) 255)
diff --git a/usr/src/boot/lib/libstand/globals.c b/usr/src/boot/lib/libstand/globals.c
index f2c624083c..83b9f777a8 100644
--- a/usr/src/boot/lib/libstand/globals.c
+++ b/usr/src/boot/lib/libstand/globals.c
@@ -25,12 +25,14 @@ char hostname[FNAME_SIZE]; /* our hostname */
int hostnamelen;
char domainname[FNAME_SIZE]; /* our DNS domain */
int domainnamelen;
+int netproto = NET_NONE; /* Network prototol */
char ifname[IFNAME_SIZE]; /* name of interface (e.g. "le0") */
struct in_addr myip; /* my ip address */
struct in_addr nameip; /* DNS server ip address */
struct in_addr rootip; /* root ip address */
struct in_addr swapip; /* swap ip address */
struct in_addr gateip; /* gateway ip address */
+struct in_addr tftpip; /* TFTP ip address */
n_long netmask = 0xffffff00; /* subnet or net mask */
u_int intf_mtu; /* interface mtu from bootp/dhcp */
int errno; /* our old friend */
diff --git a/usr/src/boot/lib/libstand/net.h b/usr/src/boot/lib/libstand/net.h
index ce7df49f2d..b7fc912eca 100644
--- a/usr/src/boot/lib/libstand/net.h
+++ b/usr/src/boot/lib/libstand/net.h
@@ -36,6 +36,8 @@
* $FreeBSD$
*/
+#ifndef _STAND_NET_H
+#define _STAND_NET_H
#ifndef _KERNEL /* XXX - see <netinet/in.h> */
#undef __IPADDR
#define __IPADDR(x) htonl((u_int32_t)(x))
@@ -45,6 +47,12 @@
#define BA { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
+enum net_proto {
+ NET_NONE,
+ NET_NFS,
+ NET_TFTP
+};
+
/* Returns true if n_long's on the same net */
#define SAMENET(a1, a2, m) ((a1.s_addr & m) == (a2.s_addr & m))
@@ -74,6 +82,7 @@ extern char hostname[FNAME_SIZE];
extern int hostnamelen;
extern char domainname[FNAME_SIZE];
extern int domainnamelen;
+extern int netproto;
extern char ifname[IFNAME_SIZE];
/* All of these are in network order. */
@@ -82,6 +91,7 @@ extern struct in_addr rootip;
extern struct in_addr swapip;
extern struct in_addr gateip;
extern struct in_addr nameip;
+extern struct in_addr tftpip;
extern n_long netmask;
extern u_int intf_mtu;
@@ -120,3 +130,4 @@ n_long inet_addr(char *);
/* Machine-dependent functions: */
time_t getsecs(void);
+#endif /* ! _STAND_NET_H */
diff --git a/usr/src/boot/lib/libstand/nfs.c b/usr/src/boot/lib/libstand/nfs.c
index 222b2f50af..29f8ecf514 100644
--- a/usr/src/boot/lib/libstand/nfs.c
+++ b/usr/src/boot/lib/libstand/nfs.c
@@ -458,6 +458,9 @@ nfs_open(const char *upath, struct open_file *f)
int error;
char *path;
+ if (netproto != NET_NFS)
+ return (EINVAL);
+
#ifdef NFS_DEBUG
if (debug)
printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath);
@@ -1100,6 +1103,9 @@ nfs_open(const char *upath, struct open_file *f)
int error;
char *path;
+ if (netproto != NET_NFS)
+ return (EINVAL);
+
#ifdef NFS_DEBUG
if (debug)
printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath);
diff --git a/usr/src/boot/lib/libstand/tftp.c b/usr/src/boot/lib/libstand/tftp.c
index cb84970910..b3d2da7b0e 100644
--- a/usr/src/boot/lib/libstand/tftp.c
+++ b/usr/src/boot/lib/libstand/tftp.c
@@ -402,6 +402,9 @@ tftp_open(const char *path, struct open_file *f)
size_t pathsize;
const char *extraslash;
+ if (netproto != NET_TFTP)
+ return (EINVAL);
+
if (strcmp(f->f_dev->dv_name, "net") != 0) {
#ifdef __i386__
if (strcmp(f->f_dev->dv_name, "pxe") != 0)
diff --git a/usr/src/boot/sys/boot/common/dev_net.c b/usr/src/boot/sys/boot/common/dev_net.c
index 5999e97cb4..fd208769ce 100644
--- a/usr/src/boot/sys/boot/common/dev_net.c
+++ b/usr/src/boot/sys/boot/common/dev_net.c
@@ -167,8 +167,14 @@ net_open(struct open_file *f, ...)
setenv("boot.netif.ip", inet_ntoa(myip), 1);
setenv("boot.netif.netmask", intoa(netmask), 1);
setenv("boot.netif.gateway", inet_ntoa(gateip), 1);
- setenv("boot.nfsroot.server", inet_ntoa(rootip), 1);
- setenv("boot.nfsroot.path", rootpath, 1);
+ setenv("boot.netif.server", inet_ntoa(rootip), 1);
+ if (netproto == NET_TFTP) {
+ setenv("boot.tftproot.server", inet_ntoa(rootip), 1);
+ setenv("boot.tftproot.path", rootpath, 1);
+ } else {
+ setenv("boot.nfsroot.server", inet_ntoa(rootip), 1);
+ setenv("boot.nfsroot.path", rootpath, 1);
+ }
if (intf_mtu != 0) {
char mtu[16];
snprintf(mtu, sizeof(mtu), "%u", intf_mtu);
@@ -375,6 +381,13 @@ net_parse_rootpath()
int i;
n_long addr = INADDR_NONE;
+ netproto = NET_NFS;
+
+ if (tftpip.s_addr != 0) {
+ netproto = NET_TFTP;
+ addr = tftpip.s_addr;
+ }
+
for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++)
if (rootpath[i] == ':')
break;
diff --git a/usr/src/boot/sys/boot/efi/loader/conf.c b/usr/src/boot/sys/boot/efi/loader/conf.c
index b805baffa8..594b1809ce 100644
--- a/usr/src/boot/sys/boot/efi/loader/conf.c
+++ b/usr/src/boot/sys/boot/efi/loader/conf.c
@@ -53,6 +53,7 @@ struct fs_ops *file_system[] = {
&ufs_fsops,
&cd9660_fsops,
&dosfs_fsops,
+ &tftp_fsops,
&nfs_fsops,
&bzipfs_fsops,
NULL
diff --git a/usr/src/boot/sys/boot/i386/libi386/Makefile b/usr/src/boot/sys/boot/i386/libi386/Makefile
index 01ac880691..6809e30898 100644
--- a/usr/src/boot/sys/boot/i386/libi386/Makefile
+++ b/usr/src/boot/sys/boot/i386/libi386/Makefile
@@ -53,9 +53,6 @@ LIBZFS= ../../zfs
SRCS += $(LIBZFS)/devicename_stubs.c
OBJS += devicename_stubs.o
-# Enable PXE TFTP or NFS support, not both.
-CFLAGS += -DLOADER_TFTP_SUPPORT
-
BOOT_COMCONSOLE_PORT= 0x3f8
CFLAGS += -DCOMPORT=${BOOT_COMCONSOLE_PORT}
diff --git a/usr/src/boot/sys/boot/i386/libi386/pxe.c b/usr/src/boot/sys/boot/i386/libi386/pxe.c
index 5f97fbe68a..de2e45c10a 100644
--- a/usr/src/boot/sys/boot/i386/libi386/pxe.c
+++ b/usr/src/boot/sys/boot/i386/libi386/pxe.c
@@ -287,10 +287,15 @@ pxe_open(struct open_file *f, ...)
bootp(pxe_sock, BOOTP_PXE);
if (rootip.s_addr == 0)
rootip.s_addr = bootplayer.sip;
-#ifdef LOADER_NFS_SUPPORT
- if (!rootpath[0])
+
+ netproto = NET_NFS;
+ if (tftpip.s_addr != 0) {
+ netproto = NET_TFTP;
+ rootip.s_addr = tftpip.s_addr;
+ }
+
+ if (netproto == NET_NFS && !rootpath[0])
strcpy(rootpath, PXENFSROOTPATH);
-#endif
for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++)
if (rootpath[i] == ':')
@@ -305,6 +310,7 @@ pxe_open(struct open_file *f, ...)
setenv("boot.netif.ip", inet_ntoa(myip), 1);
setenv("boot.netif.netmask", intoa(netmask), 1);
setenv("boot.netif.gateway", inet_ntoa(gateip), 1);
+ setenv("boot.netif.server", inet_ntoa(rootip), 1);
if (bootplayer.Hardware == ETHER_TYPE) {
sprintf(temp, "%6D", bootplayer.CAddr, ":");
setenv("boot.netif.hwaddr", temp, 1);
@@ -314,17 +320,18 @@ pxe_open(struct open_file *f, ...)
snprintf(mtu, sizeof(mtu), "%u", intf_mtu);
setenv("boot.netif.mtu", mtu, 1);
}
-#ifdef LOADER_NFS_SUPPORT
+
printf("pxe_open: server addr: %s\n", inet_ntoa(rootip));
printf("pxe_open: server path: %s\n", rootpath);
printf("pxe_open: gateway ip: %s\n", inet_ntoa(gateip));
- setenv("boot.nfsroot.server", inet_ntoa(rootip), 1);
- setenv("boot.nfsroot.path", rootpath, 1);
-#else
- setenv("boot.netif.server", inet_ntoa(rootip), 1);
- setenv("boot.tftproot.path", rootpath, 1);
-#endif
+ if (netproto == NET_TFTP) {
+ setenv("boot.tftproot.server", inet_ntoa(rootip), 1);
+ setenv("boot.tftproot.path", rootpath, 1);
+ } else if (netproto == NET_NFS) {
+ setenv("boot.nfsroot.server", inet_ntoa(rootip), 1);
+ setenv("boot.nfsroot.path", rootpath, 1);
+ }
setenv("dhcp.host-name", hostname, 1);
setenv("pxeboot.ip", inet_ntoa(myip), 1);
@@ -358,10 +365,10 @@ pxe_close(struct open_file *f)
if (pxe_opens > 0)
return(0);
-#ifdef LOADER_NFS_SUPPORT
- /* get an NFS filehandle for our root filesystem */
- pxe_setnfshandle(rootpath);
-#endif
+ if (netproto == NET_NFS) {
+ /* get an NFS filehandle for our root filesystem */
+ pxe_setnfshandle(rootpath);
+ }
if (pxe_sock >= 0) {
@@ -426,7 +433,6 @@ pxe_perror(int err)
return;
}
-#ifdef LOADER_NFS_SUPPORT
/*
* Reach inside the libstand NFS code and dig out an NFS handle
* for the root filesystem.
@@ -537,7 +543,6 @@ pxe_setnfshandle(char *rootpath)
setenv("boot.nfsroot.nfshandlelen", buf, 1);
}
#endif /* OLD_NFSV2 */
-#endif /* LOADER_NFS_SUPPORT */
void
pxenv_call(int func)
diff --git a/usr/src/boot/sys/boot/i386/loader/Makefile b/usr/src/boot/sys/boot/i386/loader/Makefile
index 887879abbb..b475549941 100644
--- a/usr/src/boot/sys/boot/i386/loader/Makefile
+++ b/usr/src/boot/sys/boot/i386/loader/Makefile
@@ -53,7 +53,7 @@ INTERNALPROG=
# architecture-specific loader code
SRCS= main.c conf.c vers.c chain.c
-CPPFLAGS += -DLOADER_TFTP_SUPPORT -DLOADER_GZIP_SUPPORT
+CPPFLAGS += -DLOADER_GZIP_SUPPORT
# Enable BootForth
CPPFLAGS += -DBOOT_FORTH -I$(SRC)/common/ficl -I../../ficl
diff --git a/usr/src/boot/sys/boot/i386/loader/conf.c b/usr/src/boot/sys/boot/i386/loader/conf.c
index 66916dd8c1..b47c9219e8 100644
--- a/usr/src/boot/sys/boot/i386/loader/conf.c
+++ b/usr/src/boot/sys/boot/i386/loader/conf.c
@@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$");
* XXX as libi386 and biosboot merge, some of these can become linker sets.
*/
-#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT)
-#error "Cannot have both tftp and nfs support yet."
-#endif
-
#if defined(LOADER_FIREWIRE_SUPPORT)
extern struct devsw fwohci;
#endif
@@ -57,9 +53,7 @@ extern struct devsw fwohci;
struct devsw *devsw[] = {
&bioscd,
&biosdisk,
-#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT)
&pxedisk,
-#endif
#if defined(LOADER_FIREWIRE_SUPPORT)
&fwohci,
#endif
@@ -85,12 +79,8 @@ struct fs_ops *file_system[] = {
#if defined(LOADER_NANDFS_SUPPORT)
&nandfs_fsops,
#endif
-#ifdef LOADER_NFS_SUPPORT
- &nfs_fsops,
-#endif
-#ifdef LOADER_TFTP_SUPPORT
&tftp_fsops,
-#endif
+ &nfs_fsops,
#ifdef LOADER_BZIP2_SUPPORT
&bzipfs_fsops,
#endif
diff --git a/usr/src/lib/libdladm/common/libdladm.c b/usr/src/lib/libdladm/common/libdladm.c
index 37823ce913..211a775d89 100644
--- a/usr/src/lib/libdladm/common/libdladm.c
+++ b/usr/src/lib/libdladm/common/libdladm.c
@@ -835,14 +835,21 @@ dladm_valid_linkname(const char *link)
{
size_t len = strlen(link);
const char *cp;
+ int nd = 0;
if (len >= MAXLINKNAMELEN)
return (B_FALSE);
- /*
- * The link name cannot start with a digit and must end with a digit.
- */
- if ((isdigit(link[0]) != 0) || (isdigit(link[len - 1]) == 0))
+ /* Link name cannot start with a digit */
+ if (isdigit(link[0]))
+ return (B_FALSE);
+ /* Link name must end with a number without leading zeroes */
+ cp = link + len - 1;
+ while (isdigit(*cp)) {
+ cp--;
+ nd++;
+ }
+ if (nd == 0 || (nd > 1 && *(cp + 1) == '0'))
return (B_FALSE);
/*
@@ -1085,8 +1092,8 @@ fail:
* is allocated here but should be freed by the caller.
*/
dladm_status_t
-dladm_strs2range(char **prop_val, uint_t val_cnt,
- mac_propval_type_t type, mac_propval_range_t **range)
+dladm_strs2range(char **prop_val, uint_t val_cnt, mac_propval_type_t type,
+ mac_propval_range_t **range)
{
int i;
char *endp;
diff --git a/usr/src/man/man1m/dladm.1m b/usr/src/man/man1m/dladm.1m
index dc9c4cbe94..d10f529ecb 100644
--- a/usr/src/man/man1m/dladm.1m
+++ b/usr/src/man/man1m/dladm.1m
@@ -9,7 +9,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DLADM 1M "Oct 01, 2016"
+.TH DLADM 1M "Dec 16, 2016"
.SH NAME
dladm \- administer data links
.SH SYNOPSIS
@@ -530,7 +530,7 @@ Number of packets sent on this link.
.ad
.sp .6
.RS 4n
-Number of bytes received on this link.
+Number of bytes sent on this link.
.RE
.sp
@@ -1024,7 +1024,7 @@ should operate. Supported values are \fBoff\fR, \fBactive\fR or \fBpassive\fR.
.sp .6
.RS 4n
Specifies the \fBLACP\fR timer value. The supported values are \fBshort\fR or
-\fBlong\fRjjj.
+\fBlong\fR.
.RE
.sp
@@ -2558,7 +2558,7 @@ See "Options," above.
.RS 4n
Display VLAN configuration for all VLAN links or for the specified VLAN link.
.sp
-The \fBshow-vlan\fRsubcommand accepts the following options:
+The \fBshow-vlan\fR subcommand accepts the following options:
.sp
.ne 2
.na
@@ -5243,7 +5243,7 @@ properties at initial negotiation.
.LP
Note that the \fBadv_autoneg_cap\fR does not have an \fBen_autoneg_cap\fR
counterpart: the \fBadv_autoneg_cap\fR is a 0/1 switch that turns off/on
-autonegotiation itself, and therefore cannot be impacted by Power Management.
+auto-negotiation itself, and therefore cannot be impacted by Power Management.
.sp
.LP
In addition, the following Ethernet properties are reported:
diff --git a/usr/src/uts/common/fs/zfs/zfs_vnops.c b/usr/src/uts/common/fs/zfs/zfs_vnops.c
index 829d57b760..138d3813b2 100644
--- a/usr/src/uts/common/fs/zfs/zfs_vnops.c
+++ b/usr/src/uts/common/fs/zfs/zfs_vnops.c
@@ -1143,7 +1143,7 @@ zfs_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
error = dmu_sync(zio, lr->lr_common.lrc_txg,
zfs_get_done, zgd);
- ASSERT(error || lr->lr_length <= zp->z_blksz);
+ ASSERT(error || lr->lr_length <= size);
/*
* On success, we need to wait for the write I/O