Move DNS TTL definitions to header; add TTL for answers to legacy unicast queries.

fe
This commit is contained in:
df 2020-07-26 20:54:31 +01:00
parent 17ef47d6f2
commit 2ce1bb8ae4
2 changed files with 6 additions and 4 deletions

4
mdns.c
View File

@ -40,10 +40,6 @@
#include <netinet/in.h> #include <netinet/in.h>
#endif #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 */ /* DETECT_CYCLE checks malformed packet you should handle the value carefully */
/* https://www.kb.cert.org/vuls/id/23495 */ /* https://www.kb.cert.org/vuls/id/23495 */
#define DETECT_CYCLE 255 #define DETECT_CYCLE 255

6
mdns.h
View File

@ -40,6 +40,12 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #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 #ifndef MDNS_DEBUG_PRINTF
#define MDNS_DEBUG_PRINTF 0 #define MDNS_DEBUG_PRINTF 0
#endif #endif