[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: resolv binary (partman-nbd) broken



Wouter Verhelst <wouter@debian.org> (2014-02-21):
> It seemed to work when I originally wrote it; but today, I noticed this:
> 
> wouter@carillon:~/debian/debian-installer/packages/partman-nbd$ ./resolv db.debian.org
> pÐ@
> 82.195.75.106
> 
> The first is supposed to be an IPv6 address; instead, it is junk.
> 
> I'm not sure what exactly happens, nor what the bug in the code is. Any
> help would be welcome.

You want to check “man inet_ntop” and try:

-                               inet_ntop(rp->ai_family, addr, host, rp->ai_addrlen);
+                               inet_ntop(rp->ai_family, addr, host, NI_MAXHOST);

or probably better, in case host's declaration changes over time:
-                               inet_ntop(rp->ai_family, addr, host, rp->ai_addrlen);
+                               inet_ntop(rp->ai_family, addr, host, sizeof(host));

> [1] It might make sense to ship it with something more generic, but I
>     couldn't think of a good udeb to put it in.

Somewhere inside src:debian-installer-utils maybe? di-utils would look
right to me at first glance.

Mraw,
KiBi.

Attachment: signature.asc
Description: Digital signature


Reply to: