diff options
author | Michal Sekletar <msekleta@redhat.com> | 2014-06-19 15:14:14 +0200 |
---|---|---|
committer | Michal Sekletar <msekleta@redhat.com> | 2014-07-07 12:17:55 +0200 |
commit | 58587a7a0c3bf5595190486781d3bbc00654c6ef (patch) | |
tree | 891be26a4bdfdfe7ad3be79396083e545752ee3a /src/libsystemd-network/sd-dhcp-client.c | |
parent | 31cda3d1759dee3e48c8ed4a949d99f041bdca1c (diff) |
dhcp-network: add check for DHCP.chaddr
Check that received DHCP packets actually include our MAC address in
chaddr field. BPF interpreter has 32 bit wide registers but MAC address
is 48 bits long so we have to do check in two steps.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-client.c')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index d8a9d20e4c..6b19666c3b 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -751,7 +751,7 @@ static int client_start(sd_dhcp_client *client) { client->xid = random_u32(); - r = dhcp_network_bind_raw_socket(client->index, &client->link, client->xid); + r = dhcp_network_bind_raw_socket(client->index, &client->link, client->xid, client->client_id.mac_addr); if (r < 0) { client_stop(client, r); return r; @@ -795,7 +795,7 @@ static int client_timeout_t2(sd_event_source *s, uint64_t usec, void *userdata) client->state = DHCP_STATE_REBINDING; client->attempt = 1; - r = dhcp_network_bind_raw_socket(client->index, &client->link, client->xid); + r = dhcp_network_bind_raw_socket(client->index, &client->link, client->xid, client->client_id.mac_addr); if (r < 0) { client_stop(client, r); return 0; |