Subject: amanda-dev-client broken on 64bit sparc platforms
To: None <email@example.com>
From: Gert Doering <firstname.lastname@example.org>
Date: 12/04/2003 19:57:34
Setup: NetBSD 1.6.2_RC1 on Sparc64,
using amanda-dev from the most recent pkgsrc CVS
The amanda server works on netbsd/sparc64 (mostly) fine - there are some
issues with disk size calculation, but overall, it works well.
The client (amandad) just refused to work. This is unchanged since many
months. The problem shows in the amandad debug file as this:
amandad: dgram_send_addr: sendto(0.0.0.0.0) failed: Address family not supported by protocol family
Nobody else seemed to be affected by it, so nobody fixed it :-) - thus I
started some debugging and hacking today, and found the problem. In the
"amanda-dev-common" package, the file common-src/dgram.c contains the
code sequence (dgram_recv(), about line 250):
addrlen = sizeof(struct sockaddr_in);
size = recvfrom(sock, dgram->data, MAX_DGRAM, 0,
(struct sockaddr *)fromaddr, &addrlen);
on sparc64, size_t is a 64bit long. recvfrom() expects a "socklen_t * "
as 6th argument, which is 32bit (unsigned int).
So recvfrom() always finds a "0" in the high word, and never returns
address data in "fromaddr".
Changing the declaration to
fixed the problem (unsurprisingly), and amandad works.
I'd send a patch, but I'm confused about the way the pkgsrc structure
works for amanda-dev (amanda-dev-client, -server, -common, etc.
interacting) so I'd rather ask someone who understands this to
verify and integrate this one-line change.
USENET is *not* the non-clickable part of WWW!
Gert Doering - Munich, Germany email@example.com
fax: +49-89-35655025 firstname.lastname@example.org