Rationalise DNS packet-buffer size calculations.
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index 3e5f51e..27928fe 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -90,7 +90,12 @@
#endif
if (daemon->edns_pktsz < PACKETSZ)
- daemon->edns_pktsz = option_bool(OPT_DNSSEC_VALID) ? EDNS_PKTSZ : PACKETSZ;
+ daemon->edns_pktsz = PACKETSZ;
+#ifdef HAVE_DNSSEC
+ /* Enforce min packet big enough for DNSSEC */
+ if (option_bool(OPT_DNSSEC_VALID) && daemon->edns_pktsz < EDNS_PKTSZ)
+ daemon->edns_pktsz = EDNS_PKTSZ;
+#endif
daemon->packet_buff_sz = daemon->edns_pktsz > DNSMASQ_PACKETSZ ?
daemon->edns_pktsz : DNSMASQ_PACKETSZ;
daemon->packet = safe_malloc(daemon->packet_buff_sz);