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

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