From 7f135438b8f05bacf0f1cc4deee44a27ad15c150 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 1 Nov 2020 19:24:24 +0100 Subject: [PATCH] dhcp4d: mention apple-suggested lease time of 1 hour --- internal/dhcp4d/dhcp4d.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/internal/dhcp4d/dhcp4d.go b/internal/dhcp4d/dhcp4d.go index 2bf2ea7..070dc52 100644 --- a/internal/dhcp4d/dhcp4d.go +++ b/internal/dhcp4d/dhcp4d.go @@ -89,13 +89,17 @@ func NewHandler(dir string, iface *net.Interface, ifaceName string, conn net.Pac copy(start, serverIP) start[len(start)-1] += 1 return &Handler{ - rawConn: conn, - iface: iface, - leasesHW: make(map[string]int), - leasesIP: make(map[int]*Lease), - serverIP: serverIP, - start: start, - leaseRange: 230, + rawConn: conn, + iface: iface, + leasesHW: make(map[string]int), + leasesIP: make(map[int]*Lease), + serverIP: serverIP, + start: start, + leaseRange: 230, + // Apple recommends a DHCP lease time of 1 hour in + // https://support.apple.com/de-ch/HT202068, + // so if 20 minutes ever causes any trouble, + // we should try increasing it to 1 hour. LeasePeriod: 20 * time.Minute, options: dhcp4.Options{ dhcp4.OptionSubnetMask: []byte{255, 255, 255, 0},