summaryrefslogtreecommitdiff
path: root/usr/src/lib/libdhcpagent
diff options
context:
space:
mode:
authorCody Peter Mello <cody.mello@joyent.com>2015-09-28 18:54:43 +0000
committerCody Peter Mello <cody.mello@joyent.com>2015-10-13 19:13:36 +0000
commit632f82b174b504331d8629ebb1a096bab69b6810 (patch)
tree104f83ee830fa7132d5e57bec582d109df478904 /usr/src/lib/libdhcpagent
parentac0a0c16e96b64cdfdc17638bb31a18b68feb90e (diff)
downloadillumos-joyent-632f82b174b504331d8629ebb1a096bab69b6810.tar.gz
OS-4741 Add support for multiple addresses & IPv6 to lx-branded zones
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Diffstat (limited to 'usr/src/lib/libdhcpagent')
-rw-r--r--usr/src/lib/libdhcpagent/common/dhcpagent_util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/src/lib/libdhcpagent/common/dhcpagent_util.c b/usr/src/lib/libdhcpagent/common/dhcpagent_util.c
index 1c381fa08f..7a44ae5249 100644
--- a/usr/src/lib/libdhcpagent/common/dhcpagent_util.c
+++ b/usr/src/lib/libdhcpagent/common/dhcpagent_util.c
@@ -36,6 +36,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <zone.h>
#include "dhcpagent_ipc.h"
#include "dhcpagent_util.h"
@@ -125,6 +126,12 @@ dhcp_start_agent(int timeout)
int ctfd;
pid_t childpid;
ctid_t ct;
+ char dhcpcmd[MAXPATHLEN];
+ const char *zroot = zone_get_nroot();
+
+ /* Prepend the root of the native code in the brand to the command */
+ (void) snprintf(dhcpcmd, sizeof (dhcpcmd), "%s%s", zroot != NULL ?
+ zroot : "", DHCP_AGENT_PATH);
/*
* just send a dummy request to the agent to find out if it's
@@ -160,7 +167,7 @@ dhcp_start_agent(int timeout)
goto fail;
case 0:
- (void) execl(DHCP_AGENT_PATH, DHCP_AGENT_PATH, (char *)0);
+ (void) execl(dhcpcmd, dhcpcmd, (char *)0);
_exit(EXIT_FAILURE);
default: