Your message dated Tue, 21 Sep 2010 06:48:12 +0000
with message-id <[email protected]>
and subject line Bug#580473: fixed in atftp 0.7.dfsg-9.1
has caused the Debian Bug report #580473,
regarding atftp: Broken on systems mixing IPv4 and IPv6
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
580473: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580473
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: atftp
Version: 0.7.dfsg-9
Severity: serious
Tags: patch
thanks

On a running system where IPv6 is active, the functionality
of the client atftp is completely broken. The cause is found
in the library call gethostbyname(), which returns a IPv6-mapped
address for any IPv4 host. Atftp cannot handle this, and
aborts any transmission in the first sendto().

The following patch resolves the calamity.

-- 
Mats Erik Andersson, fil. dr
2459 41E9 C420 3F6D F68B  2E88 F768 4541 F25B 5D41

Abbonerar på: debian-mentors, debian-devel-games, debian-perl,
              debian-ipv6, debian-qa
Description: Enable address resolution on systems with valid IPv6.
 The previous use of gethostbyname() in the lookup function
 set_peer() does not work at all on systems where IPv4 as
 well as IPv6 are in productive use. In fact, it returns the
 IPv6 address structure, and thus cause a failure in the very
 first sendto() used for transmission. The solution is to
 migrate the code to use getaddrinfo().
Author: Mats Erik Andersson <[email protected]>
Forwarded: no
Last-Update: 2010-05-06
--- atftp-0.7.dfsg.debian/tftp.c
+++ atftp-0.7.dfsg/tftp.c
@@ -408,7 +408,7 @@ int process_cmd(int argc, char **argv)
  */
 int set_peer(int argc, char **argv)
 {
-     struct hostent *host;      /* for host name lookup */
+     struct addrinfo hints, *ai;   /* for host name lookup */
      struct servent *sp;        /* server entry for tftp service */
 
      /* sanity check */
@@ -425,19 +425,18 @@ int set_peer(int argc, char **argv)
           return ERR;
      }
 
+     memset(&hints, 0, sizeof(hints));
+     hints.ai_flags = AI_CANONNAME;
+     hints.ai_socktype = SOCK_DGRAM;
+     hints.ai_family = AF_INET;
+
      /* look up the host */
-     host = gethostbyname(argv[1]);
-     /* if valid, update s_inn structure */
-     if (host)
+     if (getaddrinfo(argv[1], "tftp", &hints, &ai) == 0)
      {
-          data.sa_peer.sin_family = host->h_addrtype;
-          if (host->h_length > sizeof(data.sa_peer.sin_addr))
-               host->h_length = sizeof(data.sa_peer.sin_addr);
-          memcpy(&data.sa_peer.sin_addr, host->h_addr, host->h_length);
-          Strncpy(data.hostname, host->h_name,
+          memcpy(&data.sa_peer, ai->ai_addr, ai->ai_addrlen);
+          Strncpy(data.hostname, ai->ai_canonname,
                   sizeof(data.hostname));
           data.hostname[sizeof(data.hostname)-1] = 0;
-          data.sa_peer.sin_port = sp->s_port;
      } 
      else
      {

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: atftp
Source-Version: 0.7.dfsg-9.1

We believe that the bug you reported is fixed in the latest version of
atftp, which is due to be installed in the Debian FTP archive:

atftp_0.7.dfsg-9.1.diff.gz
  to main/a/atftp/atftp_0.7.dfsg-9.1.diff.gz
atftp_0.7.dfsg-9.1.dsc
  to main/a/atftp/atftp_0.7.dfsg-9.1.dsc
atftp_0.7.dfsg-9.1_i386.deb
  to main/a/atftp/atftp_0.7.dfsg-9.1_i386.deb
atftpd_0.7.dfsg-9.1_i386.deb
  to main/a/atftp/atftpd_0.7.dfsg-9.1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
tony mancill <[email protected]> (supplier of updated atftp package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Wed, 15 Sep 2010 21:24:52 -0700
Source: atftp
Binary: atftp atftpd
Architecture: source i386
Version: 0.7.dfsg-9.1
Distribution: unstable
Urgency: low
Maintainer: Ludovic Drolez <[email protected]>
Changed-By: tony mancill <[email protected]>
Description: 
 atftp      - advanced TFTP client
 atftpd     - advanced TFTP server
Closes: 580473
Changes: 
 atftp (0.7.dfsg-9.1) unstable; urgency=low
 .
   * Non-maintainer upload.
   * Apply IPv6 support patch by Ben Hutchings. Closes: #580473
   * Add AC_GNU_SOURCE to configure.ac to address FTBFS.
     - Patches applied directly to sources to minimize changes for NMU,
       as the current Debian packaging does not include a patch system.
Checksums-Sha1: 
 4897c38acc218ea7ca70002aab50a6cd4f2f95c8 1668 atftp_0.7.dfsg-9.1.dsc
 99cd9619984fd1521c8b60ade5268e450d2902c4 131145 atftp_0.7.dfsg-9.1.diff.gz
 c8cd8b266291900c122e33b56eedfbf482605cfd 30480 atftp_0.7.dfsg-9.1_i386.deb
 12818d441a0fcfdb18f68c19a09aded7bfe97d1e 60940 atftpd_0.7.dfsg-9.1_i386.deb
Checksums-Sha256: 
 10ea8f0eae0dd120a4a24ad7c6f1168244528f34552dd185006e3bb7833d9da9 1668 
atftp_0.7.dfsg-9.1.dsc
 0fa174cb7f18df126b8e86a5ef62e523483f6b31de16ebdbcfcfde3034edd1b2 131145 
atftp_0.7.dfsg-9.1.diff.gz
 f0e0bae0c18037dcf833562ebc7e953ee049c79c2019099c2012367a04bcdcab 30480 
atftp_0.7.dfsg-9.1_i386.deb
 833a1049861836042061cf5fcb8afe8b52733afd5b4458491cb0ec40cdd3526e 60940 
atftpd_0.7.dfsg-9.1_i386.deb
Files: 
 7813f4eb3aa7f0509963c51f591a0a71 1668 net extra atftp_0.7.dfsg-9.1.dsc
 0b9ac704e24d22af47cffa0d6d6296b6 131145 net extra atftp_0.7.dfsg-9.1.diff.gz
 af6844d09241ba9ee8b17af5bff73035 30480 net extra atftp_0.7.dfsg-9.1_i386.deb
 9ed807c82a78908eec8dc3e071b3df60 60940 net extra atftpd_0.7.dfsg-9.1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCAAGBQJMkaBYAAoJECHSBYmXSz6WYeIP/1l0iw+EkXPvmzeioOS7b2ga
pC8cLCTvw3YX4KGeS9ZccqOlcHUW76gXisvoWMuLsQAfd89z65cSG6FvAzfiuTmv
RJwstsNf0oeUSBz/crHcArE3CoqP6Yc0FilPpV2pN4ebmkE1bFxvxKg23MXTEXP+
PkBSQJXBU1cmR1WcWTH3RQ/vzzzuiuEvottT2U3dZJrMUL1bAjyI1sEgI0zmnvyB
HjpkwAPj9luoaAsaBMW451ZaK9yyjExKVfdizdFRkGgy2D4Pk2gl8AxDnvlG0sYv
AO8b1TDJ5sJ8zM+ZxCx6fWUHBQ3w/XnM5zHNDu8HI0UigXvv9EUKl8x2yBu010PX
ofFUmdwf2FapLwDLDCtVSKnIBb+K2nhxCNTUNK9O1yIkcmlHk1h3dOdhm5B8tsUk
uQ7Kw6cCVwMYA0iZj3RKHuKgyjvZDmImNvJCC7N8mjZ25ry9gnJuQfXHX6i5pYjP
D5xTybNhM7hb3OIibhsI4idwk7PaFDE8tzAunMQMAQ7ybINTuEBz3LMJGLqWscO8
BitLkTSCMl1DFeTLh/j1Aj7NuC+IqZOYHXAHTPeN4jwogQ2uauc99LLNvrOMaLCe
7PhM2QFsoQbvXNCAIFahDR3ZLgJQR3vyjJonb207J63d//j+wIZ7vpRVy3/bCCIF
6IE2Qo/Gmqk9mGjpppUc
=ZzUe
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to