Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.7.21.83]) by krbdev.mit.edu (8.9.3) with ESMTP id BAA15967; Fri, 2 May 2003 01:37:03 -0400 (EDT) Received: from smtp014.mail.yahoo.com (smtp014.mail.yahoo.com [216.136.173.58]) by pacific-carrier-annex.mit.edu (8.12.4/8.9.2) with SMTP id h425b3Pn020743 for ; Fri, 2 May 2003 01:37:03 -0400 (EDT) Received: from 66-215-26-54.pas-mres.charterpipeline.net (HELO XYZZY) (cbliebman@66.215.26.54 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 2 May 2003 05:37:02 -0000 Message-Id: <12fd01c3106c$d5d8bf50$0401010a@XYZZY> From: "Christopher B. Liebman" To: "Ken Raeburn" Cc: References: Subject: Re: [krbdev.mit.edu #1435] cygwin does not have inet_ntop when compiling kdc Date: Thu, 1 May 2003 22:36:50 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-Mimeole: Produced By Microsoft MimeOLE V6.00.2800.1165 RT-Send-Cc: X-RT-Original-Encoding: iso-8859-1 Content-Length: 2658 OK, it compiles ok on cygwin.... now for the testing! -- Chris ----- Original Message ----- From: "Ken Raeburn" To: Cc: Sent: Thursday, May 01, 2003 3:24 PM Subject: Re: [krbdev.mit.edu #1435] cygwin does not have inet_ntop when compiling kdc > Your patches aren't consistent. In dispatch.c, you treat > address->contents as a sockaddr_in, but it should be an in_addr, like > you've handled it in do_as_req.c and do_tgs_req.c. > > Could you try this (untested) patch to include/port-sockets.h instead? > The files you were patching directly might need updating to include > port-sockets.h if they aren't including it already. > > I haven't tried to do the IPv6 support; if Cygwin does include IPv6 > support and just doesn't supply inet_ntop, let me know, and I can > extend this to include AF_INET6 as well. (At the moment, our > configure scripts turn off IPv6 support for krb5 if various types and > functions aren't available; inet_ntop is one of them, but that can be > changed.) > > The intent of port-sockets.h is that source files including it should > be able to use a reasonably consistent interface to the socket API on > all platforms. It looks like all the UNIX systems we actively test on > right now do have inet_ntop. (We don't test on Cygwin, obviously.) > If it's not consistently available, though, either we shouldn't use > it, or we should be prepared to provide it. > > I should go back and look at the network.c case more closely; perhaps > it should just be using getnameinfo instead of inet_ntop. > > Index: port-sockets.h > =================================================================== > RCS file: /cvs/krbdev/krb5/src/include/port-sockets.h,v > retrieving revision 1.18 > diff -p -u -r1.18 port-sockets.h > --- port-sockets.h 2003/01/10 19:10:30 1.18 > +++ port-sockets.h 2003/05/01 21:52:28 > @@ -153,6 +153,21 @@ typedef struct iovec sg_buf; > #define SHUTDOWN_WRITE 1 > #define SHUTDOWN_BOTH 2 > > +#ifndef HAVE_INET_NTOP > +#define inet_ntop(AF,SRC,DST,CNT) \ > + ((AF) == AF_INET \ > + ? ((CNT) < 16 \ > + ? (SOCKET_SET_ERRNO(ENOSPC), NULL) \ > + : (sprintf((DST), "%d.%d.%d.%d", \ > + ((const unsigned char *)(const void *)(SRC))[0] & 0xff, \ > + ((const unsigned char *)(const void *)(SRC))[1] & 0xff, \ > + ((const unsigned char *)(const void *)(SRC))[2] & 0xff, \ > + ((const unsigned char *)(const void *)(SRC))[3] & 0xff), \ > + (DST))) \ > + : (SOCKET_SET_ERRNO(EAFNOSUPPORT), NULL)) > +#define HAVE_INET_NTOP > +#endif > + > #endif /* HAVE_MACSOCK_H */ > > #endif /* _WIN32 */ > > >