I tried building a CVS pull as of tonight in 64-bit mode, and it died a horrid death. A bit of debugging showed that in a number of places u_long was being used where it probably should have been u_int (u_int is 32 bit in both 32/64 bit x86, a u_long is 32 or 64 depending on flavor. As a result, trying to build the login packet dropped the values in the wrong places.
Patch attached. Somebody should probably review that I didn't get over-zealous and nail one I shouldn't have...
Patch to make it work in 64-bit...