chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cbbb3e
)
sd-dhcp: check for udp packets
author
Umut Tezduyar Lindskog
<umut.tezduyar@axis.com>
Sun, 30 Mar 2014 17:09:14 +0000
(19:09 +0200)
committer
Tom Gundersen
<teg@jklm.no>
Sun, 30 Mar 2014 18:46:20 +0000
(20:46 +0200)
Do not try to parse ICMP packets
[tomegun: slightly tweaked debug message]
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 bed942fd84345d0af51fa80dd3b9efe973408c16..9779cbd51d0de5de4885887729537a051ed86aa4 100644
(file)
--- 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,