<div dir="ltr">Hello!<div><br></div><div>I encountered a bug that makes dnsmasq segfaults when the --conntrack option is enabled.</div><div style>I am not entirely sure how to reproduce it: on my router (an Ubuntu server) it seems to occur sometimes when a remote DNS responds with ServFail to an A query.</div>
<div style><br></div><div style>Anyway, after compiling with debugging symbols, I figured out how to fix it:</div><div style><br></div><div style>$ diff dnsmasq-2.66/src/forward.c dnsmasq-2.66-fixed/src/forward.c<br></div>
<div style><div>372c372</div><div>< if (option_bool(OPT_CONNTRACK))</div><div>---</div><div>> if (udpaddr && option_bool(OPT_CONNTRACK))</div><div><br></div></div><div style><div>
<br></div><div style>Otherwise get_incoming_mark() will crash when it tries to dereference "peer_addr"</div></div></div>