From 2ce1bb8ae44cd2fcc59d8d08f5463ba290014bdd Mon Sep 17 00:00:00 2001 From: df Date: Sun, 26 Jul 2020 20:54:31 +0100 Subject: [PATCH] Move DNS TTL definitions to header; add TTL for answers to legacy unicast queries. fe --- mdns.c | 4 ---- mdns.h | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mdns.c b/mdns.c index 50ff2b1..3313e9e 100644 --- a/mdns.c +++ b/mdns.c @@ -40,10 +40,6 @@ #include #endif -/* see RFC 6762 Section 10 */ -#define DEFAULT_TTL_FOR_RECORD_WITH_HOSTNAME 120 -#define DEFAULT_TTL 4500 - /* DETECT_CYCLE checks malformed packet you should handle the value carefully */ /* https://www.kb.cert.org/vuls/id/23495 */ #define DETECT_CYCLE 255 diff --git a/mdns.h b/mdns.h index 79b44c8..45aff88 100644 --- a/mdns.h +++ b/mdns.h @@ -40,6 +40,12 @@ #include #endif +/* see RFC 6762 Section 10 */ +#define DEFAULT_TTL_FOR_RECORD_WITH_HOSTNAME 120 +#define DEFAULT_TTL 4500 +/* see RFC 6762 Section 5.4 */ +#define DEFAULT_TTL_LEGACY 10 + #ifndef MDNS_DEBUG_PRINTF #define MDNS_DEBUG_PRINTF 0 #endif