summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-04 18:47:56 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-04 18:47:56 -0400
commit20f8477be541f2486737f1be32bdb0bd0d6372fd (patch)
treeb99412abf9bf45fddc04ef330f5546059d3a444d /src/libsystemd-network
parent3fb1ac5d57954bb0d881a68777e996b46ed44ce3 (diff)
parentac83514cbf5997938344d5fbcfcbfd5021f453f9 (diff)
Merge pull request #3392 from poettering/assorted-stuff
Assorted stuff
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index a1af5da40f..ea4f03df1d 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -633,7 +633,8 @@ static int parse_request(uint8_t code, uint8_t len, const void *option, void *us
break;
case SD_DHCP_OPTION_MAXIMUM_MESSAGE_SIZE:
- if (len == 2)
+
+ if (len == 2 && unaligned_read_be16(option) >= sizeof(DHCPPacket))
req->max_optlen = unaligned_read_be16(option) - sizeof(DHCPPacket);
break;