You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by wi...@apache.org on 2014/07/27 12:01:29 UTC

git commit: updated refs/heads/master to 5091d0f

Repository: cloudstack
Updated Branches:
  refs/heads/master 7542ffc48 -> 5091d0f5c


CLOUDSTACK-7121: agent: Make IPv4/IPv6 preference configurable

This allows us to have the Agent connect to the Management Server
over IPv6 if that is listening on :::8250

With this patch it is possible to deploy a IPv6-only KVM Agent where
IPv4 traffic is still forwarded over the bridges, but the KVM Agent
itself does not have IPv4 connectivity.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5091d0f5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5091d0f5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5091d0f5

Branch: refs/heads/master
Commit: 5091d0f5c5b03cb8658f2d974103261341080825
Parents: 7542ffc
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Tue Jul 15 09:05:04 2014 +0200
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Sun Jul 27 12:00:44 2014 +0200

----------------------------------------------------------------------
 agent/src/com/cloud/agent/AgentShell.java | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5091d0f5/agent/src/com/cloud/agent/AgentShell.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/AgentShell.java b/agent/src/com/cloud/agent/AgentShell.java
index 210a860..230bafc 100644
--- a/agent/src/com/cloud/agent/AgentShell.java
+++ b/agent/src/com/cloud/agent/AgentShell.java
@@ -413,7 +413,23 @@ public class AgentShell implements IAgentShell, Daemon {
             /* By default we only search for log4j.xml */
             LogUtils.initLog4j("log4j-cloud.xml");
 
-            System.setProperty("java.net.preferIPv4Stack", "true");
+            /*
+                By default we disable IPv6 for now to maintain backwards
+                compatibility. At a later point in time we can change this
+                behavior to prefer IPv6 over IPv4.
+            */
+            boolean ipv6disabled = true;
+            String ipv6 = getProperty(null, "ipv6disabled");
+            if (ipv6 != null) {
+                ipv6disabled = Boolean.parseBoolean(ipv6);
+            }
+
+            if (ipv6disabled) {
+                s_logger.debug("Preferring IPv4 address family for agent connection");
+                System.setProperty("java.net.preferIPv4Stack", "true");
+            } else {
+                s_logger.debug("Preferring IPv6 address family for agent connection");
+            }
 
             String instance = getProperty(null, "instance");
             if (instance == null) {