Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 Support #473

Closed
brong opened this issue Nov 18, 2002 · 11 comments
Closed

IPv6 Support #473

brong opened this issue Nov 18, 2002 · 11 comments

Comments

@brong
Copy link
Member

brong commented Nov 18, 2002

From: Rob Siemborski
Bugzilla-Id: 1651
Version: 2.2.x
Owner: Rob Siemborski

@brong
Copy link
Member Author

brong commented Nov 18, 2002

From: Rob Siemborski

We want to require this before 2.2.0 goes out. CC: Hajimu UMEMOTO
<ume@mahoroba.org>

@brong
Copy link
Member Author

brong commented Nov 18, 2002

From: Rob Siemborski

Set 2.2.0 milestone

@brong
Copy link
Member Author

brong commented Nov 26, 2002

From: Larry Greenfield

added URL, reassigning to Rob since he's really our 2.2 guy right now

@brong
Copy link
Member Author

brong commented Dec 10, 2002

From: Rob Siemborski

Hajimu,

I note that the autoconf stuff uses the same macros we have in SASL (though with
a slightly different implementation of IPv6_CHECK_FUNC)

Since the cmulocal directory is shared between our products, can we just pick
one implementation of this and put it there,so we don't have to fix it in
multiple places?

@brong
Copy link
Member Author

brong commented Dec 10, 2002

From: Rob Siemborski

This patch also places a libcyrus dependency on master.

I'm guessing this is for the getaddrinfo/getnameinfo replacements...

I also note that there is a #if !(defined(FreeBSD) && FreeBSD < 3)
is there a way to avoid this with a configure check instead?

Finally, what is CYRUS_ID/the "associate" code for?

@brong
Copy link
Member Author

brong commented Jan 9, 2003

From: Hajimu UMEMOTO

> #3

No, you don't have to maintain multiple copies.
I think IPv6_CHECK_FUNC in SASLv2 was modified to be better after I
sent to sasl guys, and my local version is stay old. I just use my
local version. Please use SASLv2 version of IPv6_CHECK_FUNC.

@brong
Copy link
Member Author

brong commented Jan 9, 2003

From: Hajimu UMEMOTO

> #4

bugzilla-daemon> This patch also places a libcyrus dependency on master.

bugzilla-daemon> I'm guessing this is for the getaddrinfo/getnameinfo
replacements...

Yes, libcyrus is required only for the getaddrinfo/getnameinfo
replacements. It may better to link libcyrus only if
getaddrinfo/getnameinfo is not available.

bugzilla-daemon> I also note that there is a #if !(defined(FreeBSD) &&
FreeBSD < 3)
bugzilla-daemon> is there a way to avoid this with a configure check instead?

KAME/FreeBSD 2.X defines IPV6_BINDV6ONLY but the implementation is
incomplete. However, KAME/FreeBSD 2.X is quite old implementation and
I believe KAME/FreeBSD 2.X is not used for application platform,
anymore. So, you can simply omit this check.

bugzilla-daemon> Finally, what is CYRUS_ID/the "associate" code for?

The master may invoke two child processes for one service, one is for
IPv4 and the other is for IPv6 on the platform where IPv4-mapped IPv6
address is not premised, e.g. *BSD. For example,

    SERVICES {
      imap          cmd=&quot;imapd&quot; listen=&quot;imap&quot; prefork=0
    }

invokes two imapd.
In original implementation, each service has its own lockfile named
CONFIG_DIR/socket/CYRUS_SERVICE.lock.
The two child processes from one service breaks this locking. So, I
introduced CYRUS_ID to distinguish each processes by changing lockfile
name to CONFIG_DIR/socket/CYRUS_SERVICE-CYRUS_ID.lock.

@brong
Copy link
Member Author

brong commented Feb 5, 2003

From: Rob Siemborski

>Yes, libcyrus is required only for the getaddrinfo/getnameinfo
>replacements. It may better to link libcyrus only if
>getaddrinfo/getnameinfo is not available

I'm thinking we just want to have the getaddrinfo/getnameinfo replacements for
master separate, atleast for now. In the grand scheme of things, its easy to
reverse and doesn't hurt us much (beyond some extra files in CVS).

I'm also bouncing back and forth if we want to supply replacements in libcyrus
as well, since SASL will already have them (This is assuming that everyone is
using Cyrus SASL, and not some other implementor's, of course). Note that I
believe SASL names these symbols sasl_getaddrinfo (and friends), so we'd have to
do the same. It turns out Cyrus currently does this, I don't have a good
concept of wether it works.

I guess Hajimu is the one with the experience as to what works best. Larry will
probably flame me for trying to violate the API.

Finally, I think we'll just omit the freebsd check, maybe documenting the issue
somewhere.

@brong
Copy link
Member Author

brong commented Feb 8, 2003

From: Hajimu UMEMOTO

> I'm also bouncing back and forth if we want to supply replacements in libcyrus
> as well, since SASL will already have them (This is assuming that everyone is
> using Cyrus SASL, and not some other implementor's, of course). Note that I
> believe SASL names these symbols sasl_getaddrinfo (and friends), so we'd have to
> do the same. It turns out Cyrus currently does this, I don't have a good
> concept of wether it works.

> I guess Hajimu is the one with the experience as to what works best. Larry will
> probably flame me for trying to violate the API.

I don't recommend to just use sasl_getaddrinfo() and sasl_getnameinfo(). It
breaks the API as you mentioned.
Further, existing sasl_getaddrinfo() and sasl_getnameinfo() lack some feature
that Cyrus IMAPd requires. If you insist on using libsasl2 version, please
update getaddrinfo.c, getnameinfo.c and gai.h in sasl2 to sync with the patch
for imapd 2.2.X.

How about the attached patch. This patch adds $GAIOBJS for master/Makefile.
The patch includes only getaddrinfo()/getnameinfo() detection.

> Finally, I think we'll just omit the freebsd check, maybe documenting the issue
> somewhere.

Okay, thanks.

Index: acconfig.h
diff -u acconfig.h.orig acconfig.h
--- acconfig.h.orig Tue Feb 4 23:22:56 2003
+++ acconfig.h Fri Feb 7 11:41:45 2003
@@ -217,14 +217,7 @@
#include <sys/socket.h>

#ifndef HAVE_GETADDRINFO
-#define getaddrinfo sasl_getaddrinfo
-#define freeaddrinfo sasl_freeaddrinfo
-#define gai_strerror sasl_gai_strerror
#include "gai.h"
-#endif

-#ifndef HAVE_GETNAMEINFO
-#define getnameinfo sasl_getnameinfo
#endif

#ifndef NI_WITHSCOPEID
Index: configure.in
diff -u configure.in.orig configure.in
--- configure.in.orig Tue Feb 4 23:22:56 2003
+++ configure.in Fri Feb 7 11:38:01 2003
@@ -111,16 +111,24 @@
CMU_SOCKETS
LIBS="$LIBS ${LIB_SOCKET}"

-dnl check for IPv6 functions (fall back to sasl's if we don't have them)
-cyrus_cv_getaddrinfo=yes
+dnl check for IPv6 functions
+cyrus_cv_getaddrinfo=no
IPv6_CHECK_FUNC(getaddrinfo, [IPv6_CHECK_FUNC(gai_strerror,[
AC_DEFINE(HAVE_GETADDRINFO)

  • cyrus_cv_getaddrinfo=no])])
  • cyrus_cv_getaddrinfo=yes])])
    +if test $cyrus_cv_getaddrinfo = no; then
  • LIBOBJS="$LIBOBJS getaddrinfo.o"
  • GAIOBJS="../lib/getaddrinfo.o"
    +fi

-cyrus_cv_getnameinfo=yes
-IPv6_CHECK_FUNC(getnameinfo,

  • AC_DEFINE(HAVE_GETNAMEINFO),
  • cyrus_cv_getnameinfo=no)
    +cyrus_cv_getnameinfo=no
    +IPv6_CHECK_FUNC(getnameinfo,[
  • AC_DEFINE(HAVE_GETNAMEINFO)
  • cyrus_cv_getnameinfo=yes])
    +if test $cyrus_cv_getnameinfo = no; then
  • LIBOBJS="$LIBOBJS getnameinfo.o"
  • GAIOBJS="$GAIOBJS ../lib/getnameinfo.o"
    +fi

dnl this is to check for time things
AC_CHECK_HEADERS(sys/time.h)
@@ -132,6 +140,7 @@
AC_SUBST(PRE_SUBDIRS)
AC_SUBST(EXTRA_SUBDIRS)
AC_SUBST(DEPLIBS)
+AC_SUBST(GAIOBJS)
AC_SUBST(LOCALDEFS)
AC_FUNC_VPRINTF

Index: master/Makefile.in
diff -u master/Makefile.in.orig master/Makefile.in
--- master/Makefile.in.orig Mon Dec 16 23:34:13 2002
+++ master/Makefile.in Fri Feb 7 11:38:46 2003
@@ -54,7 +54,7 @@

DEFS = @defs@ @LOCALDEFS@
CPPFLAGS = -I. -I.. -I$(srcdir) -I$(srcdir)/../lib @CPPFLAGS@ @COM_ERR_CPPFLAGS@
-DEPLIBS = @DEPLIBS@
+DEPLIBS = @DEPLIBS@ @GAIOBJS@

CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@ @CFLAGS@ @COM_ERR_LDFLAGS@

@brong
Copy link
Member Author

brong commented Feb 8, 2003

From: Rob Siemborski

We're probably going to go with the libcyrus_min.a support that we just added to
do this.

so it should be in next week sometime. (provided the patch still applies
relatively cleanly)

@brong
Copy link
Member Author

brong commented Feb 12, 2003

From: Rob Siemborski

Committed. Woo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant