<div dir="auto">sorry, the quote was wrong. </div><div dir="auto"><br></div><div dir="auto">the stale cache issue is confirmed fixed with the patch. </div><div dir="auto"><br></div><div dir="auto"> i meant to quote this:</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><i><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">I think I've found and fixed the problem, but I don't have a macOS </span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">machine to test with, nor have a I configured a DOH proxy, so I'd </span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">appreciate it if you could re-run your tests and see if it works with </span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">the patch in place.</span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><a href="https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=d774add784d01c8346b271e8fb5cbedc44d7ed08" rel="noreferrer" target="_blank" style="font-size:1rem;font-family:-apple-system,"Helvetica Neue";word-spacing:1px">https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=d774add784d01c8346b271e8fb5cbedc44d7ed08</a><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">Thanks for the very useful bug report.</span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">Cheers,</span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">Simon.</span></i><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 2, 2023 at 15:01 Justin <<a href="mailto:cattyhouse@gmail.com">cattyhouse@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hello Simon</div><div dir="auto"><br></div><div dir="auto"><b>Reply your message </b></div><div dir="auto"><br></div><div dir="auto"><i><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">Thanks for the report. I've just pushed a code change which improves the </span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">checking of received packets to conform better with section 15.</span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><a href="https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=7500157cff8ea28ab03e6e62e0d1575e4d01746b" rel="noreferrer" style="font-size:1rem;font-family:-apple-system,"Helvetica Neue";word-spacing:1px" target="_blank">https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=7500157cff8ea28ab03e6e62e0d1575e4d01746b</a><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">Out of interest, did this cause problems in a real installation, or were </span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">you running a test suite?</span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">Cheers,</span><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px">Simon.</span><br></i></div><div dir="auto"><i><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br></span></i></div><div dir="auto"><i><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><br></span></i></div><div dir="auto"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><b>I've cloned the latest git repo and build it and tested, the issue is fixed. thank you.</b></span></div><div dir="auto"><span style="color:rgb(49,49,49);font-family:-apple-system,"Helvetica Neue";word-spacing:1px"><b><br></b></span></div><div><i><br></i><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><i>On Tue, May 2, 2023 at 13:23 Justin <<a href="mailto:cattyhouse@gmail.com" target="_blank">cattyhouse@gmail.com</a>> wrote:<br></i></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><i>it turns out, after sending stale cache to client (macOS), dnsmasq tries to query upstream, but this time, it is sending malformed packet: </i></div><div dir="auto"><i><br></i></div><div dir="auto">
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>Queries</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i><a href="http://api.github.com" target="_blank">api.github.com</a>: type A, class IN</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>Name: <a href="http://api.github.com" target="_blank">api.github.com</a></i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>[Name Length: 14]</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>[Label Count: 3]</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>Type: A (Host Address) (1)</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>Class: IN (0x0001)</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>Additional records</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>[Malformed Packet: DNS]</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>[Expert Info (Error/Malformed): Malformed Packet (Exception occurred)]</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>[Malformed Packet (Exception occurred)]</i></p>
<p style="margin:0px;font-variant-caps:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;font-size-adjust:none;font-kerning:auto;font-variant-alternates:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-east-asian:normal;font-feature-settings:normal"><i>[Severity level: Error]</i></p></div><div dir="auto"><i><br></i></div><div dir="auto"><i>and all the rest of query are sent to upstream like that.</i></div><div dir="auto"><i><br></i></div><div dir="auto"><i>notice: only reproducable if the client is macOS, and upstream is a DoH/DoT proxy like adguard/dnsproxy </i></div><div dir="auto"><i><br></i></div><div><i><br></i><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><i>On Mon, May 1, 2023 at 03:42 Justin <<a href="mailto:cattyhouse@gmail.com" target="_blank">cattyhouse@gmail.com</a>> wrote:<br></i></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div><i>Hello devs<br></i></div><div><div class="gmail_quote" dir="auto"><div dir="auto"><i><br></i></div><div dir="auto"><i>in order to use DOH/DOT, a proxy upstream is configured, when dnsmasq enables use-stale-cache, some upstream may return error when dnsmasq tries to refresh the record from upstream after stale cache is sent to client. </i></div><div dir="auto"><i><br></i></div><div dir="auto"><i>i reported the issue here in dnsproxy project, as this is the DOH proxy i am currently using. however i've tried many other Go/Rust DOH proxy ( namely doh-client, dns-over-https, dnss, cloudflared) , they all return error when dnsmasq tries to refresh the record.</i></div><div dir="auto"><i><br></i></div><div dir="auto"><div><a href="https://github.com/AdguardTeam/dnsproxy/issues/328" target="_blank"><i>https://github.com/AdguardTeam/dnsproxy/issues/328</i></a></div><div dir="auto"><i><br></i></div><div dir="auto"><i>only reproducible : if the requesting client is macOS and the upstream is a DOH proxy, Linux does not have this issue. using a udp upstream like 1.1.1.1 does not have this issue either.</i></div><div dir="auto"><i><br></i></div><div dir="auto"><i>hope you could take a look at the issue posted.</i></div></div></div></div></blockquote></div></div><i><span>-- </span><br></i><div dir="ltr" data-smartmail="gmail_signature"><i><br>Regards<br>Justin He</i></div>
</blockquote></div></div><span>-- </span><br><div dir="ltr" data-smartmail="gmail_signature"><br>Regards<br>Justin He</div>
</blockquote></div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br>Regards<br>Justin He</div>