Summary:ASTERISK-01143: Old code in dns.c breaks enum lookups
Reporter:capouch (capouch)Labels:
Date Opened:2004-03-03 13:33:55.000-0600Date Closed:2004-09-25 02:18:22
Versions:Frequency of
Description:Not sure where else, but #ifdef code depending on __Linux__, in dns.c, does not compile in the Linux code on my gcc-based system.

Once I manually define the variable, then I get a compile error on the following line:


Grepping the changelogs shows this variable removed from the code last September.


I can get EnumLookup to work if I manually #define __Linux__ and change &srvstate to &dnsstate
Comments:By: Brian West (bkw918) 2004-03-03 15:36:06.000-0600

i'm using the code with this in production and it doesn't break.  I want to see examples of the breakage.

By: James Golovich (jamesgolovich) 2004-03-03 16:22:27.000-0600

i went over this on a different bug before... the functions were added in an interim release of libc.  Since its difficult to check sub-minor versions of gcc I don't see an easy fix for this.

Capouch: what version of libc do you have?

By: capouch (capouch) 2004-03-03 17:04:00.000-0600

gcc --version
gcc 3.2.1

By: James Golovich (jamesgolovich) 2004-03-03 17:05:36.000-0600

I'm curious about the version of libc not of gcc

By: capouch (capouch) 2004-03-03 18:34:29.000-0600

Oops.  Same numbers:


By: James Golovich (jamesgolovich) 2004-03-03 18:38:23.000-0600

Ok maybe this isnt the same issue as in bug 0000744.  Since libc 2.3.1 should have all those resolv calls... They weren't in 2.2.2 but they were in 2.2.3.  Can you paste the compile errors you were getting before you changed it?

or maybe get one of us to look at your box so we can see whats happening

By: capouch (capouch) 2004-03-03 18:49:42.000-0600

Well hopefully I'm doing my homework here.

We can start with the test for __Linux__.  This appears to be the only code in the tree that uses it.  My build environment doesn't provide that definition, so none of that code is ever reached.

More interesting to me is the variable srvstate in dns.c.  I may be missing something external to that file, but it does appear that that variable isn't supposed to be there anymore.

It also appears that it should be dnsstate instead.

So, as I said, if I add a #define for __Linux__ and change srvstate to dnsstate, all works well.

What I don't understand is a) whether these things are in fact broken, and even more interesting, what's in other people's environments that allows this to work successfully.

I have done a ton of tracing; in my environment if I don't make the changes mentioned above no DNS lookups are ever issued by EnumLookup() on my asterisk box--I've sniffed as well as traced with printfs, and the code that does the lookup on each site in enum.conf isn't even invoked.

By: Mark Spencer (markster) 2004-03-04 00:46:53.000-0600

Should be fixed.  If it's not, reopen.