diff options
author | Tom Gundersen <teg@jklm.no> | 2015-07-14 20:17:11 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-07-14 20:17:11 +0200 |
commit | dad8f7f2b6eb34bead17df9b3966da9c4b4d79db (patch) | |
tree | 3030a419d76726ba4493f14fb1f3938fca89c936 /src | |
parent | 9ecec7d7668b54fa87a0a5a637ec8f0ef911766b (diff) | |
parent | a05185279bfc2420f60dc2a061d50bfcb646be70 (diff) |
Merge pull request #538 from mischief/multiple-routers
sd-dhcp-lease: fix handling of multiple routers
We only support one router, but in case more than one is given, we now ignore subsequent ones, rather than fall over.
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-lease.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index e9bf3c9fee..54417b3af3 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -451,7 +451,8 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option, break; case DHCP_OPTION_ROUTER: - lease_parse_be32(option, len, &lease->router); + if(len >= 4) + lease_parse_be32(option, 4, &lease->router); break; |