summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorSebastien Roy <seb@delphix.com>2016-08-18 15:57:34 -0700
committerMatthew Ahrens <mahrens@delphix.com>2016-08-19 15:03:12 -0700
commit03aa4c8d900cbdc3667ab4b43388d480324be58e (patch)
treed94bda38d5644b7c87c1655e9bc9c73ff6bf9a7c /usr/src
parent831abf2c3ce98eddc86402eb1c97c92fa48c7349 (diff)
downloadillumos-joyent-03aa4c8d900cbdc3667ab4b43388d480324be58e.tar.gz
7240 adding DHCP address through libipadm fails
Reviewed by: Frank Salzmann <frank@delphix.com> Reviewed by: Basil Crow <basil.crow@delphix.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h b/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h
index 5dcb6b5b40..be2da33666 100644
--- a/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h
+++ b/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h
@@ -22,6 +22,9 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+ */
#ifndef _DHCPAGENT_IPC_H
#define _DHCPAGENT_IPC_H
@@ -255,8 +258,13 @@ typedef hrtime_t dhcp_ipc_id_t;
/*
* note: the first 4 fields of the dhcp_ipc_request_t and dhcp_ipc_reply_t
* are intentionally identical; code in dhcpagent_ipc.c counts on it!
+ *
+ * we pack these structs to ensure that their lengths will be identical between
+ * 32-bit and 64-bit executables.
*/
+#pragma pack(4)
+
struct dhcp_ipc_request {
dhcp_ipc_type_t message_type; /* type of request */
dhcp_ipc_id_t ipc_id; /* per-socket unique request id */
@@ -276,13 +284,10 @@ struct dhcp_ipc_reply {
uchar_t buffer[1]; /* dynamically extended */
};
-/*
- * since ansi c won't let us define arrays with 0 elements, the
- * size of the ipc request/reply structures is off-by-1; use macros.
- */
+#pragma pack()
-#define DHCP_IPC_REPLY_SIZE (sizeof (dhcp_ipc_reply_t) - 1)
-#define DHCP_IPC_REQUEST_SIZE (sizeof (dhcp_ipc_request_t) - 1)
+#define DHCP_IPC_REPLY_SIZE offsetof(dhcp_ipc_reply_t, buffer)
+#define DHCP_IPC_REQUEST_SIZE offsetof(dhcp_ipc_request_t, buffer)
#define DHCP_IPC_DEFAULT_WAIT 120 /* seconds */