Re: scotty-2.1.2 / dns-Query / Linux

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Thu, 5 Sep 1996 16:46:39 +0200

Sven Probst <Sven.Probst@heim4.tu-clausthal.de> said:

Sven> I have a problem using ip_discover in tkined... all IP-addresses are
Sven> shown "reversed" (139.174.2.20 -> 20.2.174.139). Same if using the
Sven> example "nslook" (scotty-2.1.2/tnm/examples/nslook ->
Sven> ./nslook localhost -> 1.0.0.127 localhost).

Another silly byte sex bug that slipped through. Below is a patch for
it. Thanks to Erik Schoenfelder for tracking this bug down.

Juergen

*** tnm/generic/tnmNetdb.c.orig Wed Aug 7 07:13:18 1996
--- tnm/generic/tnmNetdb.c Thu Sep 5 14:19:35 1996
***************
*** 218,228 ****
if (TnmSetIPAddress(interp, name, &addr) != TCL_OK) {
return TCL_ERROR;
}
! sprintf(interp->result, "%lu.%lu.%lu.%lu",
! (addr.sin_addr.s_addr >> 24) & 0xff,
! (addr.sin_addr.s_addr >> 16) & 0xff,
! (addr.sin_addr.s_addr >> 8) & 0xff,
! addr.sin_addr.s_addr & 0xff);
return TCL_OK;
}

--- 218,225 ----
if (TnmSetIPAddress(interp, name, &addr) != TCL_OK) {
return TCL_ERROR;
}
!
! strcpy(interp->result, inet_ntoa(addr.sin_addr));
return TCL_OK;
}

--
Juergen Schoenwaelder schoenw@cs.utwente.nl http://www.cs.utwente.nl/~schoenw
Computer Science Department, University of Twente,   (Fax: +31-53-489-3247)
P.O. Box 217, NL-7500 AE Enschede, The Netherlands.  (Tel. +31-53-489-3678)