libell/0001-sync-dhcp-lease-Avoid-overflow-in-t2-computation.patch
zhangzhangxin 288ff8b62c sync:dhcp-lease: Avoid overflow in t2 computation
Signed-off-by: zhangzhangxin <zhangxin1@xfusion.com>
2023-05-12 14:48:49 +08:00

27 lines
779 B
Diff

From 8c53b21d7ba7b1b2b2a8108c76d6ee935fee1639 Mon Sep 17 00:00:00 2001
From: zhangzhangxin <zhangxin1@xfusion.com>
Date: Fri, 12 May 2023 14:40:24 +0800
Subject: [PATCH] sync:dhcp-lease: Avoid overflow in t2 computation
Signed-off-by: zhangzhangxin <zhangxin1@xfusion.com>
---
ell/dhcp-lease.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ell/dhcp-lease.c b/ell/dhcp-lease.c
index 4d49190..e93c618 100644
--- a/ell/dhcp-lease.c
+++ b/ell/dhcp-lease.c
@@ -151,7 +151,7 @@ struct l_dhcp_lease *_dhcp_lease_parse_options(struct dhcp_message_iter *iter)
lease->t1 = lease->lifetime / 2;
if (!lease->t2)
- lease->t2 = lease->lifetime * 7 / 8;
+ lease->t2 = lease->lifetime / 8 * 7;
if (lease->t1 > lease->t2)
goto error;
--
2.40.0.windows.1