[4182] in Kerberos-V5-bugs
Re: [krbdev.mit.edu #1435] cygwin does not have inet_ntop when
daemon@ATHENA.MIT.EDU (liebman@zod.com via RT)
Thu May 1 23:55:56 2003
Date: Thu, 1 May 2003 23:55:47 -0400 (EDT)
Mail-Followup-To: rt@krbdev.mit.edu
Message-Id: <rt-1435-5922.1.00660631413987@krbdev.mit.edu>
In-Reply-To: <rt-1435@krbdev.mit.edu>
From: "liebman@zod.com via RT" <rt-comment@krbdev.mit.edu>
Mail-Copies-To: never
cc: krb5-prs@mit.edu
Reply-To: rt-comment@krbdev.mit.edu
Errors-To: krb5-bugs-bounces@mit.edu
Ken,
I'll give it a try and let you know!
-- Chris
----- Original Message -----
From: "Ken Raeburn" <raeburn@mit.edu>
To: <liebman@zod.com>
Cc: <krb5-bugs@mit.edu>
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 */
>
_______________________________________________
krb5-bugs mailing list
krb5-bugs@mit.edu
http://mailman.mit.edu/mailman/listinfo/krb5-bugs