[Dnsmasq-discuss] Segfault problem with --conntrack option

Giacomo Tazzari giacomo.tazzari at gmail.com
Mon Apr 22 16:11:30 BST 2013


Hello Simon,

I just tried dnsmasq-2.67test2 and I can confirm that it's working as
intended: it's not segfaulting, and connections are being marked as
expected.

Thanks a lot!

-- Giacomo


On Mon, Apr 22, 2013 at 2:22 PM, Simon Kelley <simon at thekelleys.org.uk>wrote:

> diff -u is good. But a well characterised bug, with a patch, is much
> better! Many thanks.
>
> I tweaked your patch a little, since it turns out that the information
> required to do the conntrack marking is always available in the forwarding
> record.
>
> The fixed code is in the git repo and dnsmasq-2.67test2 now. Please could
> you check that I didn't reverse your fix?
>
>
> Cheers,
>
> Simon.
>
>
>
> On 21/04/13 21:11, Giacomo Tazzari wrote:
>
>> Thanks for the tip!
>> This is the very first time I use a mailing list and the very first time I
>> submit a patch of any kind.
>>
>> diff -u dnsmasq-2.66/src/forward.c dnsmasq-2.66-fixed/src/**forward.c
>> --- dnsmasq-2.66/src/forward.c  2013-04-17 14:52:49.000000000 +0200
>> +++ dnsmasq-2.66-fixed/src/**forward.c    2013-04-21 18:08:31.755258777
>> +0200
>> @@ -369,7 +369,7 @@
>>
>>   #ifdef HAVE_CONNTRACK
>>                    /* Copy connection mark of incoming query to outgoing
>> connection. */
>> -                 if (option_bool(OPT_CONNTRACK))
>> +                 if (udpaddr&&  option_bool(OPT_CONNTRACK))
>>
>>                      {
>>                        unsigned int mark;
>>                        if (get_incoming_mark(udpaddr, dst_addr, 0,&mark))
>>
>>
>> On Sun, Apr 21, 2013 at 9:50 PM, Matthias Andree<matthias.andree at gmx.de>*
>> *wrote:
>>
>>  Am 21.04.2013 18:34, schrieb Giacomo Tazzari:
>>>
>>>> Hello!
>>>>
>>>> I encountered a bug that makes dnsmasq segfaults when the --conntrack
>>>> option is enabled.
>>>> 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.
>>>>
>>>> Anyway, after compiling with debugging symbols, I figured out how to fix
>>>>
>>> it:
>>>
>>>>
>>>> $ diff dnsmasq-2.66/src/forward.c dnsmasq-2.66-fixed/src/**forward.c
>>>> 372c372
>>>> <                  if (option_bool(OPT_CONNTRACK))
>>>> ---
>>>>
>>>>>                  if (udpaddr&&  option_bool(OPT_CONNTRACK))
>>>>>
>>>>
>>>>
>>> I am not speaking on behalf of Simon,
>>>
>>> but please, for any diff/patch submissions (not only for dnsmasq, but
>>> any open source project I've worked with), always use diff -u, or if
>>> your diff does not offer that option, diff -c, because that way it is
>>> easier to review, and also easier to apply should anything have changed.
>>>
>>> Please re-send your patch in that format to ease Simon's work.
>>>
>>> Thank you.
>>>
>>>
>>> ______________________________**_________________
>>> Dnsmasq-discuss mailing list
>>> Dnsmasq-discuss at lists.**thekelleys.org.uk<Dnsmasq-discuss at lists.thekelleys.org.uk>
>>> http://lists.thekelleys.org.**uk/mailman/listinfo/dnsmasq-**discuss<http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss>
>>>
>>>
>>
>>
>> ______________________________**_________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.**thekelleys.org.uk<Dnsmasq-discuss at lists.thekelleys.org.uk>
>> http://lists.thekelleys.org.**uk/mailman/listinfo/dnsmasq-**discuss<http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss>
>>
>
>
> ______________________________**_________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.**thekelleys.org.uk<Dnsmasq-discuss at lists.thekelleys.org.uk>
> http://lists.thekelleys.org.**uk/mailman/listinfo/dnsmasq-**discuss<http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20130422/47d5474a/attachment.html>


More information about the Dnsmasq-discuss mailing list