Simplify EDNS0 packet size handling.

In the post 2020 flag-day world, we limit UDP packets to 1232 bytes
which can go anywhere, so the dodgy code to try and determine the
functional maxmimum packet size on the path from upstream servers
is obsolete.
This commit is contained in:
Simon Kelley
2024-11-24 23:06:22 +00:00
parent 04d7693d86
commit f04cf8506a
5 changed files with 31 additions and 75 deletions

View File

@@ -594,8 +594,7 @@ struct server {
char interface[IF_NAMESIZE+1];
unsigned int ifindex; /* corresponding to interface, above */
struct serverfd *sfd;
int tcpfd, edns_pktsz;
time_t pktsz_reduced;
int tcpfd;
unsigned int queries, failed_queries, nxdomain_replies, retrys;
unsigned int query_latency, mma_latency;
time_t forwardtime;
@@ -769,9 +768,8 @@ struct dyndir {
#define FREC_AD_QUESTION 32
#define FREC_DO_QUESTION 64
#define FREC_ADDED_PHEADER 128
#define FREC_TEST_PKTSZ 256
#define FREC_HAS_PHEADER 512
#define FREC_GONE_TO_TCP 1024
#define FREC_HAS_PHEADER 256
#define FREC_GONE_TO_TCP 512
struct frec {
struct frec_src {
@@ -1864,7 +1862,7 @@ void from_wire(char *name);
unsigned char *find_pseudoheader(struct dns_header *header, size_t plen,
size_t *len, unsigned char **p, int *is_sign, int *is_last);
size_t add_pseudoheader(struct dns_header *header, size_t plen, unsigned char *limit,
unsigned short udp_sz, int optno, unsigned char *opt, size_t optlen, int set_do, int replace);
int optno, unsigned char *opt, size_t optlen, int set_do, int replace);
size_t add_do_bit(struct dns_header *header, size_t plen, unsigned char *limit);
size_t add_edns0_config(struct dns_header *header, size_t plen, unsigned char *limit,
union mysockaddr *source, time_t now, int *cacheable);