You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4535 Reporter: ecc Status: acknowledged (set by @damiendoligez on 2008-09-23T00:51:51Z) Resolution: open Priority: normal Severity: feature Version: 3.10.1 Category: otherlibs Monitored by:@ygrek
Bug description
Please add a function to the Unix module that allows one to distinguish between IPv4 and IPv6 inet_addrs.
For example, when printing a sockaddr, I would like to print
1.2.3.4:666 for an IPv4 host, but
[::1]:666 for an IPv6 one.
Of course, I can search for ':' in the string returned by string_of_inet_addr, but that's a hack.
The text was updated successfully, but these errors were encountered:
This can already be done by using Unix.domain_of_sockaddr which will return Unix.PF_INET for an IPv4 address or Unix.PF_INET6 for an IPv6 address.
However, this is tedious as it requires you to create a socket just to determine the address family of an inet_addr.
Both win32unix/unix.ml and unix/unix.ml contain a function called is_inet6_addr which is used in Unix.domain_of_sockaddr - could this function be added to unix.mli in the next release of OCaml?
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
Original bug ID: 4535
Reporter: ecc
Status: acknowledged (set by @damiendoligez on 2008-09-23T00:51:51Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.10.1
Category: otherlibs
Monitored by: @ygrek
Bug description
Please add a function to the Unix module that allows one to distinguish between IPv4 and IPv6 inet_addrs.
For example, when printing a sockaddr, I would like to print
1.2.3.4:666 for an IPv4 host, but
[::1]:666 for an IPv6 one.
Of course, I can search for ':' in the string returned by string_of_inet_addr, but that's a hack.
The text was updated successfully, but these errors were encountered: