mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
sd-dhcp: check for ipv4 packets
This commit is contained in:
parent
d454a6748c
commit
6e34949d72
@ -130,6 +130,11 @@ int dhcp_packet_verify_headers(DHCPPacket *packet, size_t len, bool checksum) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (packet->ip.version != IPVERSION) {
|
||||
log_dhcp_client(client, "ignoring packet: not IPv4");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (packet->ip.ihl < 5) {
|
||||
log_dhcp_client(client, "ignoring packet: IPv4 IHL (%u words) invalid",
|
||||
packet->ip.ihl);
|
||||
|
Loading…
Reference in New Issue
Block a user