[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: CLDAP with IPv6: address storage

If the platform has INET6 support we can use sockaddr_storage instead. I
don't think breaking compatibility is a serious issue since CLDAP support is
only experimental.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

> -----Original Message-----
> From: owner-openldap-devel@OpenLDAP.org
> [mailto:owner-openldap-devel@OpenLDAP.org]On Behalf Of Thorild Selen
> Sent: Tuesday, February 04, 2003 6:05 AM
> To: openldap-devel@OpenLDAP.org
> Subject: CLDAP with IPv6: address storage
> Greetings,
> Concerning storage of IPv6 addresses (that won't fit in a struct
> sockaddr):
> I mentioned in my followup 3 to ITS#2018 that the same problem seems
> to be present in
> libraries/liblber/sockbuf.c:
>    sb_dgram_read()
>    sb_dgram_write()
> libraries/libldap/result.c:
>    try_read1msg()
> and saw now that this hadn't been fixed yet in HEAD. However, this
> seems to concern CLDAP only, where, as the comment in
> libraries/liblber/sockbuf.c says: "All data reads and writes are
> prefixed with a sockaddr containing the address of the remote entity."
> This is simply not going to work with IPv6 addresses.
> One way to fix this would be to use a struct sockaddr_storage instead,
> but that would break compatibility. A possible workaround could be
> checking the address family and use a struct sockaddr_storage for
> IPv6, otherwise a struct sockaddr, but that looks a bit ugly to
> me. What do you people think?
> Thorild Selén
> Datorföreningen Update / Update Computer Club, Uppsala, SE