From 9752eb5f9813da6b9f82a1da2fdff7abd4916324 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 7 Oct 2019 15:46:59 +0200 Subject: [PATCH] autoip: Make max-conflics and rate-limit configurable These constants are defined in RFC-3927 (10 conflicts before rate limiting and 60 seconds between attempts) and are not intended to be configurable. We cannot pass BCT without adjusting these params, though. Ref IDF-4843 --- src/include/lwip/prot/autoip.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/include/lwip/prot/autoip.h b/src/include/lwip/prot/autoip.h index fd3af8a9..96f93f57 100644 --- a/src/include/lwip/prot/autoip.h +++ b/src/include/lwip/prot/autoip.h @@ -59,8 +59,13 @@ extern "C" { #define ANNOUNCE_NUM 2 /* (number of announcement packets) */ #define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ #define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ +#if ESP_LWIP +#define MAX_CONFLICTS LWIP_AUTOIP_MAX_CONFLICTS /* (max conflicts before rate limiting) */ +#define RATE_LIMIT_INTERVAL LWIP_AUTOIP_RATE_LIMIT_INTERVAL /* seconds (delay between successive attempts) */ +#else #define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */ #define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */ +#endif #define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ /* AutoIP client states */