mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Use a simpler arrangement for the all_addr union to avoid
the compiler padding it with an extra 8 bytes. Use the F_KEYTAG flag in a a cache record to discriminate between an arbitrary RR stored entirely in the addr union and one which has a point to block storage.
This commit is contained in:
@@ -329,21 +329,23 @@ union all_addr {
|
||||
unsigned short keytag, algo, digest, rcode;
|
||||
int ede;
|
||||
} log;
|
||||
/* for arbitrary RR record. */
|
||||
/* for arbitrary RR record stored in block */
|
||||
struct {
|
||||
#define RR_IMDATALEN 13 /* 16 - sizeof(short) - sizeof (char) */
|
||||
unsigned short rrtype;
|
||||
char len; /* -1 for blockdata */
|
||||
union {
|
||||
char data[RR_IMDATALEN];
|
||||
struct {
|
||||
unsigned short datalen;
|
||||
struct blockdata *rrdata;
|
||||
} block;
|
||||
} u;
|
||||
} rr;
|
||||
unsigned short datalen;
|
||||
struct blockdata *rrdata;
|
||||
} rrblock;
|
||||
/* for arbitrary RR record small enough to go in addr.
|
||||
NOTE: rrblock and rrdata are discriminated by the F_KEYTAG bit
|
||||
in the cache flags. */
|
||||
struct datablock {
|
||||
unsigned short rrtype;
|
||||
unsigned char datalen;
|
||||
char data[];
|
||||
} rrdata;
|
||||
};
|
||||
|
||||
#define RR_IMDATALEN (sizeof(union all_addr) - offsetof(struct datablock, data))
|
||||
|
||||
struct bogus_addr {
|
||||
int is6, prefix;
|
||||
|
||||
Reference in New Issue
Block a user