aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-04-23 12:57:43 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-04-23 12:57:43 +0200
commit12821bd6744c1576b81a7edbfe55070ef1d27415 (patch)
treeb53aabdb9390c840042f87f14562658b157dddcc
parent2dbff1bf535ea6ba4e45eaa20d7eb31fe98a8c5e (diff)
downloadstrongswan-12821bd6744c1576b81a7edbfe55070ef1d27415.tar.bz2
strongswan-12821bd6744c1576b81a7edbfe55070ef1d27415.tar.xz
include dhcp-client-identifier in the DHCP request
-rw-r--r--src/libcharon/plugins/dhcp/dhcp_socket.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libcharon/plugins/dhcp/dhcp_socket.c b/src/libcharon/plugins/dhcp/dhcp_socket.c
index f5bfe2a60..f61b3a60e 100644
--- a/src/libcharon/plugins/dhcp/dhcp_socket.c
+++ b/src/libcharon/plugins/dhcp/dhcp_socket.c
@@ -130,6 +130,7 @@ typedef enum {
DHCP_MESSAGE_TYPE = 53,
DHCP_SERVER_ID = 54,
DHCP_PARAM_REQ_LIST = 55,
+ DHCP_CLIENT_ID = 61,
DHCP_OPTEND = 255,
} dhcp_option_type_t;
@@ -238,8 +239,17 @@ static int prepare_dhcp(private_dhcp_socket_t *this,
option->data[0] = type;
optlen += sizeof(dhcp_option_t) + option->len;
+ if (identity->get_type(identity) == ID_FQDN)
+ {
+ option = (dhcp_option_t*)&dhcp->options[optlen];
+ option->type = DHCP_HOST_NAME;
+ option->len = min(chunk.len, 64);
+ memcpy(option->data, chunk.ptr, option->len);
+ optlen += sizeof(dhcp_option_t) + option->len;
+ }
+
option = (dhcp_option_t*)&dhcp->options[optlen];
- option->type = DHCP_HOST_NAME;
+ option->type = DHCP_CLIENT_ID;
option->len = min(chunk.len, 64);
memcpy(option->data, chunk.ptr, option->len);
optlen += sizeof(dhcp_option_t) + option->len;