hush/networking/udhcp
Vladislav Grishenko 6464f15ddb udhcpc: on SIGUSR1, limit renew attempts time to 20 seconds; then do total reconfig
Scenario:

1. udhcpc gets lease for 86400 secs and sleeps for 43200 before renew attempt

2. PC gets physically disconnected and connected to another network

3. some phy control software sends SIGUSR1 to renew the lease, SIGUSR2 isn't
used because newly connected network could be the same as before

4. udhcpc sends unicast renew requests until lease timeout fall to 60 sec.
They are ignored by new network dhcp servers

5. udhcpc sends broadcast rebind requests for 60 seconds, which are NAKed
or ignored too

6. udhcpc deconfigs and starting from discover state, gets new lease for the
new network

So, pt.4+5 it could take up to 86400 secs without correct lease, which is
too long and not acceptable.

Second SIGUSR1 will immediately run into deconfig/discover state, which is
not preferable in case of the same subnet replugged.

This patch makes sure after SIGUSR1 timeout is no more than -A NUM
(usually 20 sec). It means that renew will be requested via broadcast,
and if no replies come back, full deconf/reconf cycle will be initiated
in 20 seconds.

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 01:37:47 +02:00
..
arpping.c *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
common.c udhcp: add FEATURE_UDHCP_8021Q option 2011-04-26 02:50:00 +02:00
common.h udhcp: IF_UDHCP_VERBOSE() macro - improve code readability 2011-10-18 00:35:47 +02:00
Config.src udhcp: add FEATURE_UDHCP_8021Q option 2011-04-26 02:50:00 +02:00
dhcpc.c udhcpc: on SIGUSR1, limit renew attempts time to 20 seconds; then do total reconfig 2011-10-18 01:37:47 +02:00
dhcpc.h udhcpc: emit "correct" secs field 2011-03-12 05:37:54 +01:00
dhcpd.c udhcp: IF_UDHCP_VERBOSE() macro - improve code readability 2011-10-18 00:35:47 +02:00
dhcpd.h *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
dhcprelay.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
domain_codec.c *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
dumpleases.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
files.c udhcp: fix some default values from "" to NULL 2011-05-03 16:46:47 +02:00
Kbuild.src *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
leases.c udhcpd: optional IP selection based on MAC hash 2011-02-16 13:31:30 +01:00
packet.c networking: consolidate the IP checksum code. -129 bytes. 2011-09-07 17:55:40 +02:00
signalpipe.c udhcp: cosmetic cleanups; one case of s/full_read/xread/ 2010-03-26 10:09:34 +01:00
socket.c *: simplify Ethernet header includes 2011-06-10 05:17:59 +02:00
static_leases.c *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00