[comp.unix.aix] bind 4.8.x and AIX 1.2 ?

a0020@rrz.uni-koeln.de (Axel Clauberg) (07/31/90)

AIX/370 1.2's nameserver seems to be based on a very old BSD version (4.7 ?). 
As this version has a lot of bugs I'd like to install a more recent one. 
I tried to install bind 4.8.1 from Berkeley and 4.8.2. The resolver library
is working, tools like nslookup run fine using a remote server.
Running named gives you format errors when a name not being in the cache
or authoritative data is to be resolved.
Before I start to debug:
does anyone have a properly running bind (named) rel. >= 4.8.1 on AIX/370
or PS/2 release 1.2 ?

Axel
--
Axel Clauberg,    Regional Computing Center, University of Cologne
                  Robert-Koch Str. 10
                  D- 5000 Koeln 41, West-Germany

                  Phone:    +49 (221) 478-5589
                  Internet: cl@rrz.Uni-Koeln.DE
                  Bitnet:   a0020@DK0RRZK1

booga@polyslo.CalPoly.EDU (Steve Jankowski [cut]) (08/02/90)

In article <A0020.90Jul31105537@aix370.rrz.uni-koeln.de> a0020@rrz.uni-koeln.de (Axel Clauberg) writes:
>AIX/370 1.2's nameserver seems to be based on a very old BSD version (4.7 ?). 
>As this version has a lot of bugs I'd like to install a more recent one. 
>I tried to install bind 4.8.1 from Berkeley and 4.8.2. The resolver library
>is working, tools like nslookup run fine using a remote server.
>Running named gives you format errors when a name not being in the cache
>or authoritative data is to be resolved.
>Before I start to debug:
>does anyone have a properly running bind (named) rel. >= 4.8.1 on AIX/370
>or PS/2 release 1.2 ?

We have the same problem here and I've started a port of named from
4.8.1 to AIX 1.2 on a PS/2.  The problem with AIX (especially the
PS/2) is their (ahem) crappy C compiler.  named uses bit fields to pick
apart request packets.  This is a less than portable solution, but
it's ok since most C compilers honor the spirit of bit fields and
pack the bits into the smallest space possible.  But, the AIX
compiler just makes every bit field 32-bits and leaves it at that.

If you look in arpa/nameser.h you'll notice that they've put in
two unsigned chars and a bunch of macros to replace the bit fields.
(this is in the structure that represents a request packet)
This means lots of manual labor to change each reference to the
structure.  I started the work, but stopped when I heard that
we would be getting AIX 1.2 which reportedly has named from
4.8.1.  But I just string'ed the binary and I'm not impressed;
the dates in the file are all from 1986.

If I actually go through with the port and get it working, I'll
let people know.


Steve Jankowski		booga@polyslo.calpoly.edu
Cal Poly, San Luis Obispo, Computer Science
Systems Administrator       (uunet!pyramid!polyslo!booga)

-- 
Steve Jankowski --------------------------------------------------------------
booga@polyslo.CalPoly.EDU        |V|   |)         "I'm not a Sys Admin, 
                                 | |r  |)ooga      but I play one on TV."
buggercornholernoogienoogiebuggerpooper

jackv@turnkey.tcc.com (Jack F. Vogel) (08/03/90)

In article <A0020.90Jul31105537@aix370.rrz.uni-koeln.de> a0020@rrz.uni-koeln.de (Axel Clauberg) writes:
>AIX/370 1.2's nameserver seems to be based on a very old BSD version (4.7 ?). 
[...]
>Before I start to debug:
>does anyone have a properly running bind (named) rel. >= 4.8.1 on AIX/370
>or PS/2 release 1.2 ?
 
Funny you should ask :-}. What I believe is called the July preventative
update by the time it grinds through the IBM machinery includes my port of
BIND 4.8.1. This is not some small fix, it is a complete new port. You will
still probably want the bind source since we are not shipping nslookup. I
will say a little more about building this stuff in another followup. Many
of you out there will probably be interested to know that this update also
includes my port of sendmail 5.61 (yes, finally). I have left the Berkeley
SIDs in the binaries so you can verify the version levels using what.

Have fun!

Disclaimer: I fix code, I don't speak for LCC nor IBM.

-- 
Jack F. Vogel			jackv@locus.com
AIX370 Technical Support	       - or -
Locus Computing Corp.		jackv@turnkey.TCC.COM

jackv@turnkey.tcc.com (Jack F. Vogel) (08/03/90)

In article <26b7929a.68e3@petunia.CalPoly.EDU> booga@polyslo.CalPoly.EDU (Steve Jankowski [cut]) writes:

[...stuff about the nameserver being back-level deleted...]

>We have the same problem here and I've started a port of named from
>4.8.1 to AIX 1.2 on a PS/2.  The problem with AIX (especially the
>PS/2) is their (ahem) crappy C compiler.  named uses bit fields to pick
>apart request packets.  This is a less than portable solution, but
>it's ok since most C compilers honor the spirit of bit fields and
>pack the bits into the smallest space possible.  But, the AIX
>compiler just makes every bit field 32-bits and leaves it at that.
 
Yup, ran into this problem in the new port I mentioned in a previous
posting. Interestingly enough, the 370 Metaware compiler does
things correctly! However there isn't any option to the 386 compiler
to keep it from doing this, oh well :-{.

>If you look in arpa/nameser.h you'll notice that they've put in
>two unsigned chars and a bunch of macros to replace the bit fields.
>(this is in the structure that represents a request packet)
>This means lots of manual labor to change each reference to the
>structure.  I started the work, but stopped when I heard that
>we would be getting AIX 1.2 which reportedly has named from
>4.8.1.  But I just string'ed the binary and I'm not impressed;
>the dates in the file are all from 1986.
 
The new BIND is in what I believe is called the July preventative
update as I said previously, I don't know if you have to request
it or if you get it automatically. The easiest way to tell if it
is installed is to see if you have a new binary, /etc/named-xfer.
This is the asyncronous zone transfer facility, if its there you
have the new nameserver. Now a little bit on how the port was done...

In my first attempt at the code I went ahead as you described and
used the macros, and as you noticed this is a fair amount of work
and change to the code. Then a friend working in our Boston office
(Thanks Brad!) came up with a creative way around this problem and
this is what I actually implemented in the code that's shipping.
The header structure as shipped by Berkeley contains an unsigned
short id variable and then 2 unsigned chars carved up as the bitfields.
What I did was make one unsigned int as a 32-bit bitfield and just
declare the first 16 bits as the id. Doing this the PS/2 compiler
leaves things alone. You can take a look at this change after installing
the update. The important thing to observe if you use this structure
is that you must define BIT_ZERO_ON_LEFT for the 370 and BIT_ZERO_ON_RIGHT
for the PS/2.

Also, just as a tip for those out there who might want to build nslookup
or other related tools, be sure you use -DBSD=4.3 and -D_BSD in your
compiler defines in addition to those mentioned above, then in your
link command be sure and include -lbsd. With the new nameser.h and these
proper defines the BSD source should build and work without modification.

>If I actually go through with the port and get it working, I'll
>let people know.
 
Hope you don't waste too much time before you see this :-}. I suggest
you call your IBM representative and request the latest preventative
update for this fix. As I mentioned in a previous followup, I also
finished the sendmail 5.61 port and it is also in this update.

Disclaimer: I get paid to solve problems, not to speak for LCC or IBM.

-- 
Jack F. Vogel			jackv@locus.com
AIX370 Technical Support	       - or -
Locus Computing Corp.		jackv@turnkey.TCC.COM