Re: res_init() and 0.0.0.0

2013-09-17 Thread Stuart Henderson
On 2013-09-17, Kapetanakis Giannis wrote: > On 16/09/13 23:49, Stuart Henderson wrote: >> the ISC resolver is available in ports/net/libbind, this is used in some >> ports which fiddle with resolver internals in _res (e.g. net/mtr). >> > > Thanks for the tip. > > Indeed linking with libbind also f

Re: res_init() and 0.0.0.0

2013-09-17 Thread Kapetanakis Giannis
On 17/09/13 10:13, Otto Moerbeek wrote: On Tue, Sep 17, 2013 at 12:25:17AM -0400, Ted Unangst wrote: I think this will give unexpected results if ipv6 resolvers are configured. You'll notice the asr code is allocating possibly varying amounts of memory. I think you're going to want to memcpy th

Re: res_init() and 0.0.0.0

2013-09-17 Thread Kapetanakis Giannis
On 16/09/13 23:49, Stuart Henderson wrote: the ISC resolver is available in ports/net/libbind, this is used in some ports which fiddle with resolver internals in _res (e.g. net/mtr). Thanks for the tip. Indeed linking with libbind also fixed the problem with the program's resolver. The onl

Re: res_init() and 0.0.0.0

2013-09-17 Thread Otto Moerbeek
On Tue, Sep 17, 2013 at 12:25:17AM -0400, Ted Unangst wrote: > On Mon, Sep 16, 2013 at 21:23, Kapetanakis Giannis wrote: > > > The following diff fixes the problem and the program works in current. > > The program is bahamut ircd and I managed to make it work up to 5.3 > > without this. > > In cu

Re: res_init() and 0.0.0.0

2013-09-16 Thread Ted Unangst
On Mon, Sep 16, 2013 at 21:23, Kapetanakis Giannis wrote: > The following diff fixes the problem and the program works in current. > The program is bahamut ircd and I managed to make it work up to 5.3 > without this. > In current it's broken due to resolver errors. > > Don't know if you have a re

Re: res_init() and 0.0.0.0

2013-09-16 Thread Stuart Henderson
On 2013-09-13, Kapetanakis Giannis wrote: > On 13/09/13 17:36, Otto Moerbeek wrote: >> >> >> the program uses the following: >> sendto(resfd, msg, len, 0, (struct sockaddr *) >> &(_res.nsaddr_list[i]), sizeof(struct sockaddr)) >> >> instead of sending requests

Re: res_init() and 0.0.0.0

2013-09-16 Thread Kapetanakis Giannis
On 13/09/13 18:14, Otto Moerbeek wrote: On Fri, Sep 13, 2013 at 05:57:41PM +0300, Kapetanakis Giannis wrote: On 13/09/13 17:36, Otto Moerbeek wrote: the program uses the following: sendto(resfd, msg, len, 0, (struct sockaddr *) &(_res.nsaddr_list[i]), size

Re: res_init() and 0.0.0.0

2013-09-13 Thread Otto Moerbeek
On Fri, Sep 13, 2013 at 05:57:41PM +0300, Kapetanakis Giannis wrote: > On 13/09/13 17:36, Otto Moerbeek wrote: > > > > > >the program uses the following: > >sendto(resfd, msg, len, 0, (struct sockaddr *) > >&(_res.nsaddr_list[i]), sizeof(struct sockaddr)) > > >

Re: res_init() and 0.0.0.0

2013-09-13 Thread Kapetanakis Giannis
On 13/09/13 17:36, Otto Moerbeek wrote: the program uses the following: sendto(resfd, msg, len, 0, (struct sockaddr *) &(_res.nsaddr_list[i]), sizeof(struct sockaddr)) instead of sending requests to 192.168.0.1 it sends them to 127.0.0.1 (from tcpdump) any

Re: res_init() and 0.0.0.0

2013-09-13 Thread Otto Moerbeek
On Fri, Sep 13, 2013 at 05:30:50PM +0300, Kapetanakis Giannis wrote: > On 13/09/13 16:34, Otto Moerbeek wrote: > >Groping into _res is not a wise thing. The OpenBSD async resolver only > >has minimal support for that. > > > >ASR_DEBUG=1 ./a.out > > > >Will probably get you the debug info you want.

Re: res_init() and 0.0.0.0

2013-09-13 Thread Kapetanakis Giannis
On 13/09/13 16:34, Otto Moerbeek wrote: Groping into _res is not a wise thing. The OpenBSD async resolver only has minimal support for that. ASR_DEBUG=1 ./a.out Will probably get you the debug info you want. -Otto Thanks for the reply. As I said this is for debugging a legacy progra

Re: res_init() and 0.0.0.0

2013-09-13 Thread Otto Moerbeek
On Fri, Sep 13, 2013 at 03:01:45PM +0300, Kapetanakis Giannis wrote: > Hi, > > Could someone help me debug this following program on OBSD? > > #include > #include > #include > #include > #include > #include > > main() { > int i; > res_init(); > printf("Number of NS in re