summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp-packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-network/dhcp-packet.c')
-rw-r--r--src/libsystemd-network/dhcp-packet.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsystemd-network/dhcp-packet.c b/src/libsystemd-network/dhcp-packet.c
index bed942fd84..9779cbd51d 100644
--- a/src/libsystemd-network/dhcp-packet.c
+++ b/src/libsystemd-network/dhcp-packet.c
@@ -157,6 +157,11 @@ int dhcp_packet_verify_headers(DHCPPacket *packet, size_t len, bool checksum) {
/* UDP */
+ if (packet->ip.protocol != IPPROTO_UDP) {
+ log_dhcp_client(client, "ignoring packet: not UDP");
+ return -EINVAL;
+ }
+
if (len < DHCP_IP_UDP_SIZE) {
log_dhcp_client(client, "ignoring packet: packet (%zu bytes) "
" smaller than IP+UDP header (%u bytes)", len,