summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2014-03-19 14:38:59 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2014-03-20 10:55:27 +0200
commit9d7bf1d58c2ce7f383f256a5beb1f5fc4ee843f5 (patch)
tree97bcb2e003e2a47e0917d7dcf30557d14e7f94c9
parent715c6a9acd6ce4cce4fdfe8a62a32dc8f552e1d7 (diff)
libsystemd-network: Don't unnecessarily send too long packets
Since the length used by options is known, send packets with no extra padding.
-rw-r--r--src/libsystemd-network/sd-dhcp-client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index 1a57939bbf..9052b84602 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -315,7 +315,7 @@ static int client_send_discover(sd_dhcp_client *client, uint16_t secs) {
if (err < 0)
return err;
- err = dhcp_client_send_raw(client, discover, len);
+ err = dhcp_client_send_raw(client, discover, len - optlen);
if (err < 0)
return err;
@@ -385,9 +385,9 @@ static int client_send_request(sd_dhcp_client *client, uint16_t secs) {
client->lease->server_address,
DHCP_PORT_SERVER,
&request->dhcp,
- len - DHCP_IP_UDP_SIZE);
+ len - optlen - DHCP_IP_UDP_SIZE);
} else {
- err = dhcp_client_send_raw(client, request, len);
+ err = dhcp_client_send_raw(client, request, len - optlen);
}
if (err < 0)
return err;