diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-10-11 10:11:52 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-10-11 15:31:43 +0200 |
commit | 132bb54b219270304d3047eedb5d60b58d94db16 (patch) | |
tree | 636c6a5516b9a3e7c1a0ba9bb9cfe74280fdacc8 /gdhcp/client.c | |
parent | 635f1e814e4e5a0d4f8356475dff32515e78f692 (diff) | |
download | connman-132bb54b219270304d3047eedb5d60b58d94db16.tar.gz connman-132bb54b219270304d3047eedb5d60b58d94db16.tar.bz2 connman-132bb54b219270304d3047eedb5d60b58d94db16.zip |
gdhcp: Use data size specific option setting function
Instead of using dhcp_add_simple_option() the gdhcp now uses
three functions for setting uint8, uint16 and uint32 values.
Diffstat (limited to 'gdhcp/client.c')
-rw-r--r-- | gdhcp/client.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c index 7340f3a0..b023c6dd 100644 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -363,11 +363,11 @@ static int send_discover(GDHCPClient *dhcp_client, uint32_t requested) packet.secs = dhcp_attempt_secs(dhcp_client); if (requested) - dhcp_add_simple_option(&packet, DHCP_REQUESTED_IP, requested); + dhcp_add_option_uint32(&packet, DHCP_REQUESTED_IP, requested); /* Explicitly saying that we want RFC-compliant packets helps * some buggy DHCP servers to NOT send bigger packets */ - dhcp_add_simple_option(&packet, DHCP_MAX_SIZE, 576); + dhcp_add_option_uint16(&packet, DHCP_MAX_SIZE, 576); add_request_options(dhcp_client, &packet); @@ -389,9 +389,10 @@ static int send_select(GDHCPClient *dhcp_client) packet.xid = dhcp_client->xid; packet.secs = dhcp_attempt_secs(dhcp_client); - dhcp_add_simple_option(&packet, DHCP_REQUESTED_IP, - dhcp_client->requested_ip); - dhcp_add_simple_option(&packet, DHCP_SERVER_ID, dhcp_client->server_ip); + dhcp_add_option_uint32(&packet, DHCP_REQUESTED_IP, + dhcp_client->requested_ip); + dhcp_add_option_uint32(&packet, DHCP_SERVER_ID, + dhcp_client->server_ip); add_request_options(dhcp_client, &packet); @@ -451,7 +452,7 @@ static int send_release(GDHCPClient *dhcp_client, packet.xid = rand(); packet.ciaddr = htonl(ciaddr); - dhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); + dhcp_add_option_uint32(&packet, DHCP_SERVER_ID, server); return dhcp_send_kernel_packet(&packet, ciaddr, CLIENT_PORT, server, SERVER_PORT); |