1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-10 01:17:44 +03:00

libsystemd-network: Don't unnecessarily send too long packets

Since the length used by options is known, send packets with no
extra padding.
This commit is contained in:
Patrik Flykt 2014-03-19 14:38:59 +02:00
parent 715c6a9acd
commit 9d7bf1d58c

View File

@ -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;