Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow gen_nb_server to use IPv6 addresses. #249

Merged
merged 4 commits into from
Nov 13, 2012
Merged

Conversation

seancribbs
Copy link
Contributor

This supersedes #245, supporting both tuple and string-formatted addresses, and cleans up extraneous whitespace in the file.

Err ->
Err
end;
listen_on(CallbackModule, IpAddr, Port) when is_tuple(IpAddr) andalso
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't there be a catchall case here for when none of the guarded versions are satisfied, throwing an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, adding.

@ghost ghost assigned seancribbs Nov 5, 2012
@ghost ghost assigned slfritchie Nov 13, 2012
@slfritchie
Copy link
Contributor

+1 to merge, thanks!

I used the diff below to verify that the HTTP listener, PB listener, and handoff listener are all using IPv6. Note that the distributed Erlang ports are still using IPv4.

% lsof -nP -p 34359 | grep TCP
beam.smp 34359 fritchie   12u    IPv4 0x689ef020065f186d       0t0      TCP *:50005 (LISTEN)
beam.smp 34359 fritchie   13u    IPv4 0x689ef0200273386d       0t0      TCP 127.0.0.1:50006->127.0.0.1:4369 (ESTABLISHED)
beam.smp 34359 fritchie   19u    IPv6 0x689ef01fffeba72d       0t0      TCP [::1]:8099 (LISTEN)
beam.smp 34359 fritchie   20u    IPv6 0x689ef01fffeba34d       0t0      TCP [::1]:8098 (LISTEN)
beam.smp 34359 fritchie   21u    IPv6 0x689ef02014422b0d       0t0      TCP [::1]:8087 (LISTEN)

Diff:

--- rel/riak/etc/vm.args.orig   2012-11-13 11:24:58.000000000 -0600
+++ rel/riak/etc/vm.args    2012-11-13 11:25:09.000000000 -0600
@@ -1,5 +1,5 @@
 ## Name of the riak node
--name riak@127.0.0.1
+-name riak@::1

 ## Cookie for distributed erlang.  All nodes in the same cluster
 ## should use the same cookie or they will not be able to communicate.
--- rel/riak/etc/app.config.orig    2012-11-13 11:24:57.000000000 -0600
+++ rel/riak/etc/app.config 2012-11-13 11:29:34.000000000 -0600
@@ -12,7 +12,7 @@

             %% pb_ip is the IP address that the Riak Protocol Buffers interface
             %% will bind to.  If this is undefined, the interface will not run.
-            {pb_ip,   "127.0.0.1" },
+            {pb_ip,   "::1" },

             %% pb_port is the TCP port that the Riak Protocol Buffers interface
             %% will bind to
@@ -30,11 +30,11 @@

               %% http is a list of IP addresses and TCP ports that the Riak
               %% HTTP interface will bind.
-              {http, [ {"127.0.0.1", 8098 } ]},
+              {http, [ {"::1", 8098 } ]},

               %% https is a list of IP addresses and TCP ports that the Riak
               %% HTTPS interface will bind.
-              %{https, [{ "127.0.0.1", 8098 }]},
+              %{https, [{ "::1", 8098 }]},

               %% Default cert and key locations for https can be overridden
               %% with the ssl config variable, for example:
@@ -45,6 +45,7 @@

               %% riak_handoff_port is the TCP port that Riak uses for
               %% intra-cluster data handoff.
+              {handoff_ip, "::1"},
               {handoff_port, 8099 },

               %% To encrypt riak_core intra-cluster data handoff traffic,

@ghost ghost assigned seancribbs Nov 13, 2012
seancribbs added a commit that referenced this pull request Nov 13, 2012
Allow gen_nb_server to use IPv6 addresses.
@seancribbs seancribbs merged commit b251c48 into master Nov 13, 2012
@seancribbs seancribbs deleted the sdc-ipv6-gen_nb_server branch January 30, 2013 16:19
@seancribbs seancribbs removed their assignment May 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants