projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d454a67
)
sd-dhcp: check for ipv4 packets
author
Tom Gundersen
<teg@jklm.no>
Sun, 30 Mar 2014 18:33:57 +0000
(20:33 +0200)
committer
Tom Gundersen
<teg@jklm.no>
Sun, 30 Mar 2014 18:46:40 +0000
(20:46 +0200)
src/libsystemd-network/dhcp-packet.c
patch
|
blob
|
history
diff --git
a/src/libsystemd-network/dhcp-packet.c
b/src/libsystemd-network/dhcp-packet.c
index
9779cbd
..
3b62c25
100644
(file)
--- a/
src/libsystemd-network/dhcp-packet.c
+++ b/
src/libsystemd-network/dhcp-packet.c
@@
-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);