summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorMohamed Khalfella <mohamed.khalfella@joyent.com>2019-09-05 21:06:28 +0000
committerMohamed Khalfella <mohamed.khalfella@joyent.com>2019-09-05 21:12:58 +0000
commit1cc204b97b9317e681958da0e91abeb27bcc6f82 (patch)
tree1f2d3f1b769fea8e80cabdff690e26e6d2755b28 /usr
parent5a02003f48844ffada03336634b28edaff8574ec (diff)
downloadillumos-joyent-1cc204b97b9317e681958da0e91abeb27bcc6f82.tar.gz
OS-7975 bhyve should require exactly one primary nic
Reviewed by: Mike Gerdts <mike.gerdts@joyent.com> Approved by: Mike Gerdts <mike.gerdts@joyent.com>
Diffstat (limited to 'usr')
-rw-r--r--usr/src/lib/brand/bhyve/zone/boot.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/lib/brand/bhyve/zone/boot.c b/usr/src/lib/brand/bhyve/zone/boot.c
index 6e6f3dc640..51aab83daf 100644
--- a/usr/src/lib/brand/bhyve/zone/boot.c
+++ b/usr/src/lib/brand/bhyve/zone/boot.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright (c) 2018, Joyent, Inc.
+ * Copyright (c) 2019, Joyent, Inc.
*/
/*
@@ -382,7 +382,8 @@ add_nets(int *argc, char **argv)
char slotconf[MAXNAMELEN];
char *primary = NULL;
- if ((nets = get_zcfg_var("net", "resources", NULL)) == NULL) {
+ if ((nets = get_zcfg_var("net", "resources", NULL)) == NULL ||
+ strcmp(nets, "") == 0) {
return (0);
}
@@ -423,6 +424,12 @@ add_nets(int *argc, char **argv)
}
}
+ /* Make sure there is a "primary" net */
+ if (primary == NULL) {
+ (void) printf("Error: no primary net has been specified\n");
+ return (-1);
+ }
+
return (0);
}