From 9f41271f3ce82e0f7196c2442614ef4e9d360928 Mon Sep 17 00:00:00 2001 From: Michel Stam Date: Thu, 30 Oct 2014 11:59:04 +0100 Subject: udhcpd: add option for tweaking arpping Some clients have a very short timeout for sending the DHCP DISCOVER, shorter than the arpping timeout of 2000 milliseconds that udhcpd uses by default. This patch allows tweaking the timeout, or disabling of arpping altogether, at the risk of handing out addresses which are already in use. function old new delta udhcpd_main 1460 1501 +41 udhcpc_main 2814 2851 +37 packed_usage 29957 29974 +17 arpping 477 493 +16 find_free_or_expired_nip 161 174 +13 send_offer 285 292 +7 nobody_responds_to_arp 85 89 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 7/0 up/down: 135/0) Total: 135 bytes Signed-off-by: Michel Stam Signed-off-by: Denys Vlasenko --- networking/udhcp/common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'networking/udhcp/common.h') diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index e5e0f2599..d20659e2f 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h @@ -311,7 +311,8 @@ int arpping(uint32_t test_nip, const uint8_t *safe_mac, uint32_t from_ip, uint8_t *from_mac, - const char *interface) FAST_FUNC; + const char *interface, + unsigned timeo) FAST_FUNC; /* note: ip is a pointer to an IPv6 in network order, possibly misaliged */ int sprint_nip6(char *dest, /*const char *pre,*/ const uint8_t *ip) FAST_FUNC; -- cgit v1.2.3