Hi Baptiste,

Op 19-2-2020 om 13:06 schreef Baptiste:
Hi,

I found a couple of bugs in that part of the code.
Can you please try the attached patch? (0001 is useless but I share it too in case of)
Works for me, thanks!
It will allow parsing of additional records for SRV queries only and when done, will silently ignore any record which are not A or AAAA.

@maint team, please don't apply the patch yet, I want to test it much more before.

When the final patch is ready ill be happy to give it a try as well.
Baptiste

On a side note. With config below i would expect 2 servers with status 'MAINT(resolving)'.

Using this configuration in Unbound (4 server IP's defined.):
server:
local-data: "_https._tcp.pkg.test.tld 3600 IN SRV 0 100 80 srv1.test.tld"
local-data: "_https._tcp.pkg.test.tld 3600 IN SRV 0 100 80 srv2.test.tld"
local-data: "srv1.test.tld 3600 IN A 192.168.0.51"
local-data: "srv2.test.tld 3600 IN A 192.168.0.52"
local-data: "srvX.test.tld 3600 IN A 192.168.0.53"
local-data: "srvX.test.tld 3600 IN A 192.168.0.54"

And this in a HAProxy backend:
    server-template            PB_SRVrecords 3 ipv4@_https._tcp.pkg.test.tld:77 id 10110 check inter 180000 resolvers globalresolvers resolve-prefer ipv4     server-template            PB_multipleA 3 [email protected]:78 id 10111 check inter 180000  resolvers globalresolvers resolve-prefer ipv4Results in 6 servers, but 1 is

This results in 6 servers of which 1 server has 'MAINT(resolution)' status and 1 has an IP of 0.0.0.0 but shows as 'DOWN'. I would have expected 2 servers with status MAINT.? (p.s. none of the IP's actually exist on my network so that the other servers are also shown as down is correct..)

PB_ipv4,PB_SRVrecords1,0,0,0,0,,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,1,1,124,124,,1,10102,10110,,0,,2,0,,0,L4CON,,74995,0,0,0,0,0,0,,,,,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 connection problem,,2,3,0,,,,192.168.0.51:80,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0, PB_ipv4,PB_SRVrecords2,0,0,0,0,,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,1,1,94,94,,1,10102,2,,0,,2,0,,0,L4CON,,75029,0,0,0,0,0,0,,,,,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 connection problem,,2,3,0,,,,192.168.0.52:80,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0, PB_ipv4,PB_SRVrecords3,0,0,0,0,,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,1,1,64,64,,1,10102,3,,0,,2,0,,0,L4CON,,75039,0,0,0,0,0,0,,,,,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 connection problem,,2,3,0,,,,0.0.0.0:77,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0, PB_ipv4,PB_multipleA1,0,0,0,0,,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,1,2,34,34,,1,10102,10111,,0,,2,0,,0,L4CON,,75002,0,0,0,0,0,0,,,,,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 connection problem,,2,3,0,,,,192.168.0.53:78,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0, PB_ipv4,PB_multipleA2,0,0,0,0,,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,1,2,4,4,,1,10102,5,,0,,2,0,,0,L4CON,,75014,0,0,0,0,0,0,,,,,0,0,,,,,-1,,,0,0,0,0,,,,Layer4 connection problem,,2,3,0,,,,192.168.0.54:78,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0, PB_ipv4,PB_multipleA3,0,0,0,0,,0,0,0,,0,,0,0,0,0,MAINT (resolution),1,1,0,0,1,199,199,,1,10102,6,,0,,2,0,,0,,,,0,0,0,0,0,0,,,,,0,0,,,,,-1,,,0,0,0,0,,,,,,,,,,,,0.0.0.0:78,,http,,,,,,,,0,0,0,,,0,,0,0,0,0,0,

If additional info is desired, please let me know :).

On Tue, Feb 18, 2020 at 2:03 PM Baptiste <[email protected] <mailto:[email protected]>> wrote:

    Hi guys,

    Thx Tim for investigating.
    I'll check the PCAP and see why such behavior happens.

    Baptiste


    On Tue, Feb 18, 2020 at 12:09 AM Tim Düsterhus <[email protected]
    <mailto:[email protected]>> wrote:

        Pieter,

        Am 09.02.20 um 15:35 schrieb PiBa-NL:
        > Before commit '2.2-dev0-13a9232, released 2020/01/22 (use
        additional
        > records from SRV responses)' i get seemingly proper working
        resolving of
        > server a name.
        > After this commit all responses are counted as 'invalid' in
        the socket
        > stats.

        I can confirm the issue with the provided configuration. The
        'if (len ==
        0) {' check in line 1045 of the commit causes HAProxy to
        consider the
        responses 'invalid':

Thanks for confirming :).


        
https://github.com/haproxy/haproxy/commit/13a9232ebc63fdf357ffcf4fa7a1a5e77a1eac2b#diff-b2ddf457bc423779995466f7d8b9d147R1045-R1048

        Best regards
        Tim Düsterhus

Regards,
PiBa-NL (Pieter)


Reply via email to