Commit graph

16 commits

Author SHA1 Message Date
jvd23
d96e9e5dc3 lib9: fix memory leak in dial of regular file (#284) 2020-01-13 11:38:17 -05:00
Dan Cross
fa325e9b42 Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-10 14:54:30 +00:00
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
Jani Lahtinen
0c2ef23ff3 lib9: fix local addr in dial
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/4826049
2011-08-16 14:02:11 -04:00
Fazlul Shahriar
5186b55afc dial: allow host==0 when net=="unix"
http://codereview.appspot.com/108042
2009-08-17 11:34:33 -04:00
Russ Cox
6d558e12b0 dial: reject dial to * (aka 0.0.0.0)
fixes #15 http://code.swtch.com/plan9port/issues/15

http://codereview.appspot.com/107043
2009-08-15 02:48:08 -04:00
rsc
6215fd56f1 experiment: translation from standard notations to plan 9 in netmkaddr 2006-07-23 02:56:37 +00:00
rsc
3d484b0d1a set qid.vers (Erik Quanstrom) 2005-12-29 21:41:54 +00:00
rsc
74f9b0c62c allow broadcast 2005-12-26 03:58:43 +00:00
rsc
835c1e4786 better error messages 2005-07-13 03:55:44 +00:00
rsc
e5d68728eb add local address to dial 2005-02-13 18:33:26 +00:00
rsc
e42882dc96 publish p9dialparse 2004-06-16 16:45:09 +00:00
rsc
d51419bf43 various tweaks. 2004-02-09 19:33:05 +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