Commit graph

9 commits

Author SHA1 Message Date
David du Colombier
3dade5fe59 lib9/dial: fix addrlen in connect() and bind()
On some systems, the third argument of connect() and bind()
is expected to be the length of the address family instead
of the length of the sockaddr structure.

R=rsc
http://codereview.appspot.com/6489072
2012-09-04 18:45:19 -04:00
David du Colombier
3409bc9ae1 lib9/dial: add support for IPv6
The function p9dialparse() returns the host as a sockaddr_storage
structure instead of a u32int, to be able to handle both IPv4
and IPv6 addresses. Because the sockaddr_storage structure also
handle port numbers and Unix path names, there is no longer
need to set them in the calling functions. However, these values
are still returned for convenience.

The sockaddr_in and sockaddr_un structures have been replaced
by sockaddr_storage to handle Unix, IPv4 and IPv6 sockets.

Names and addresses are resolved using either gethostbyname()
or getaddrinfo() functions.

The getaddrinfo() function is documented in RFC2553 and standardized
since POSIX.1-2001. It supports both IPv4 and IPv6 addresses.
The gethostbyname() function is deprecated since POSIX.1-2008.
However, some libc implementations don't handle getaddrinfo()
properly, thus we preferred to try gethostbyname() first.

I've tried to preserve most of the old code logic to prevent
from surprising or unwanted behavior.

R=rsc
http://codereview.appspot.com/6255068
2012-06-02 21:50:59 +02:00
rsc
2e9749ec60 unix is not a variable name 2005-07-13 10:50:16 +00:00
rsc
e42882dc96 publish p9dialparse 2004-06-16 16:45:09 +00:00
rsc
bd2e802053 DAMN BERKELEY. 2004-06-16 03:50:28 +00:00
rsc
8ad517944e Today's changes.
More changes.
2004-03-25 23:03:57 +00:00
rsc
32f69c36e0 Add support for user-level 9P servers/clients and various bug fixes to go with them. 2003-12-11 17:48:38 +00:00
rsc
1c253ceb58 Annoying changes to work on Sun boxes. 2003-11-23 19:49:17 +00:00
rsc
fd04aacee1 Various additions and fixes. 2003-11-23 18:12:54 +00:00