summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2014-01-31 11:31:20 +0200
committerTom Gundersen <teg@jklm.no>2014-01-31 12:04:51 +0100
commit74e22380ed1d753130e9194186aefdf58449050e (patch)
tree735997e7561011fb3f33338a1c818632c9a94634 /src
parent29804cc1e0f37ee34301530fd7f1eb8550be464e (diff)
libsystemd-dhcp: DNS name option must be a multiple of 4 bytes
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-dhcp/sd-dhcp-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c b/src/libsystemd-dhcp/sd-dhcp-client.c
index 7e5c36a857..8115b7f769 100644
--- a/src/libsystemd-dhcp/sd-dhcp-client.c
+++ b/src/libsystemd-dhcp/sd-dhcp-client.c
@@ -760,7 +760,7 @@ static int client_parse_offer(uint8_t code, uint8_t len, const uint8_t *option,
break;
case DHCP_OPTION_DOMAIN_NAME_SERVER:
- if (len >= 4) {
+ if (len && !(len % 4)) {
unsigned i;
lease->dns_size = len / 4;