summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-02-16 23:28:19 +0100
committerTom Gundersen <teg@jklm.no>2014-02-16 23:28:19 +0100
commit9fadd4cabf57285e58272ddb75147d8d52d4c5a9 (patch)
treea542427047835c142f62e4fa45dac36bff455775
parent489e4fbb8c04bf26bb363bfdf4bbcd1505398528 (diff)
sd-dhcp: silently ignore malformed packets
This fixes a regression introduced in e5002702.
-rw-r--r--src/libsystemd-dhcp/sd-dhcp-client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c b/src/libsystemd-dhcp/sd-dhcp-client.c
index 83d56a244e..d58755a603 100644
--- a/src/libsystemd-dhcp/sd-dhcp-client.c
+++ b/src/libsystemd-dhcp/sd-dhcp-client.c
@@ -710,11 +710,11 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message,
assert(message);
if (be32toh(message->xid) != client->xid)
- return -EINVAL;
+ return 0;
if (memcmp(&message->chaddr[0], &client->mac_addr.ether_addr_octet,
ETHER_ADDR_LEN))
- return -EINVAL;
+ return 0;
switch (client->state) {
case DHCP_STATE_SELECTING:
@@ -843,7 +843,7 @@ static int client_receive_message_udp(sd_event_source *s, int fd,
r = dhcp_packet_verify_headers(packet, BOOTREPLY, len);
if (r < 0)
- return r;
+ return 0;
len -= DHCP_IP_UDP_SIZE;