X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Fforward.c;h=74e5ab66c423a9d09f48c9cab7a82f258de3576a;hb=86fa1046920dedc8134136a6244ca96e8a37e9d8;hp=592243fd4d3542445e2033f25138113ab3025903;hpb=b059c96dc69dfe3055c5b32b078a05c53b11ebb3;p=people%2Fms%2Fdnsmasq.git diff --git a/src/forward.c b/src/forward.c index 592243f..74e5ab6 100644 --- a/src/forward.c +++ b/src/forward.c @@ -799,8 +799,10 @@ void reply_query(int fd, int family, time_t now) } /* We tried resending to this server with a smaller maximum size and got an answer. - Make that permanent. */ - if (server && (forward->flags & FREC_TEST_PKTSZ)) + Make that permanent. To avoid reduxing the packet size for an single dropped packet, + only do this when we get a truncated answer, or one larger than the safe size. */ + if (server && (forward->flags & FREC_TEST_PKTSZ) && + ((header->hb3 & HB3_TC) || n >= SAFE_PKTSZ)) server->edns_pktsz = SAFE_PKTSZ; /* If the answer is an error, keep the forward record in place in case