diff options
Diffstat (limited to 'shared/n-dhcp4')
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-c-lease.c | 5 | ||||
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-outgoing.c | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/shared/n-dhcp4/src/n-dhcp4-c-lease.c b/shared/n-dhcp4/src/n-dhcp4-c-lease.c index db1ffbae..208ad92a 100644 --- a/shared/n-dhcp4/src/n-dhcp4-c-lease.c +++ b/shared/n-dhcp4/src/n-dhcp4-c-lease.c @@ -44,10 +44,7 @@ static int n_dhcp4_incoming_get_timeouts(NDhcp4Incoming *message, uint64_t *t1p, } else if (u32 == UINT32_MAX) { lifetime = UINT64_MAX; } else { - if (u32 == UINT32_MAX) - lifetime = UINT64_MAX; - else - lifetime = u32 * (1000000000ULL); + lifetime = u32 * (1000000000ULL); } r = n_dhcp4_incoming_query_t2(message, &u32); diff --git a/shared/n-dhcp4/src/n-dhcp4-outgoing.c b/shared/n-dhcp4/src/n-dhcp4-outgoing.c index c44b5880..99123308 100644 --- a/shared/n-dhcp4/src/n-dhcp4-outgoing.c +++ b/shared/n-dhcp4/src/n-dhcp4-outgoing.c @@ -54,8 +54,6 @@ int n_dhcp4_outgoing_new(NDhcp4Outgoing **outgoingp, size_t max_size, uint8_t overload) { _c_cleanup_(n_dhcp4_outgoing_freep) NDhcp4Outgoing *outgoing = NULL; - c_assert(!(overload & ~(N_DHCP4_OVERLOAD_FILE | N_DHCP4_OVERLOAD_SNAME))); - /* * Make sure the minimum limit is bigger than the maximum protocol * header plus the DHCP-message-header plus a single OPTION_END byte. @@ -64,6 +62,8 @@ int n_dhcp4_outgoing_new(NDhcp4Outgoing **outgoingp, size_t max_size, uint8_t ov sizeof(NDhcp4Message) + 1, "Invalid minimum IP packet limit"); + c_assert(!(overload & ~(N_DHCP4_OVERLOAD_FILE | N_DHCP4_OVERLOAD_SNAME))); + outgoing = calloc(1, sizeof(*outgoing)); if (!outgoing) return -ENOMEM; |