Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(73)

Issue 6255068: code review 6255068: lib9/dial: add support for IPv6 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by 0intro
Modified:
11 years, 8 months ago
Reviewers:
rsc
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r d124aa7084af https://code.google.com/p/plan9port #

Total comments: 2

Patch Set 3 : diff -r d124aa7084af https://code.google.com/p/plan9port #

Patch Set 4 : diff -r d124aa7084af https://code.google.com/p/plan9port #

Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -121 lines) Patch
M include/libc.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/vbackup/vmount.c View 1 4 chunks +10 lines, -9 lines 0 comments Download
M src/cmd/vbackup/vmount0.c View 1 4 chunks +10 lines, -9 lines 0 comments Download
M src/lib9/_p9dialparse.c View 1 6 chunks +55 lines, -54 lines 0 comments Download
M src/lib9/announce.c View 1 4 chunks +9 lines, -19 lines 0 comments Download
M src/lib9/dial.c View 1 2 6 chunks +24 lines, -29 lines 0 comments Download

Messages

Total messages: 6
0intro
Hello rsc, I'd like you to review this change to https://code.google.com/p/plan9port/
11 years, 11 months ago (2012-05-31 12:50:06 UTC) #1
rsc
LGTM http://codereview.appspot.com/6255068/diff/5002/src/lib9/dial.c File src/lib9/dial.c (right): http://codereview.appspot.com/6255068/diff/5002/src/lib9/dial.c#newcode22 src/lib9/dial.c:22: int static int?
11 years, 11 months ago (2012-06-02 17:02:19 UTC) #2
0intro
https://codereview.appspot.com/6255068/diff/5002/src/lib9/dial.c File src/lib9/dial.c (right): https://codereview.appspot.com/6255068/diff/5002/src/lib9/dial.c#newcode22 src/lib9/dial.c:22: int On 2012/06/02 17:02:19, rsc wrote: > static int? ...
11 years, 11 months ago (2012-06-02 19:28:30 UTC) #3
rsc
LGTM
11 years, 11 months ago (2012-06-02 19:40:47 UTC) #4
0intro
*** Submitted as 697c23cebcec *** lib9/dial: add support for IPv6 The function p9dialparse() returns the ...
11 years, 11 months ago (2012-06-02 19:54:44 UTC) #5
rsc
11 years, 8 months ago (2012-09-04 22:43:01 UTC) #6
This fails on OS X.

listen1 tcp!localhost!9001 date

gives EINVAL returned from announce. Any ideas?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b