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/17 22:38:56 UTC

git commit: updated refs/heads/agent-ipv6 to 12572e8

Repository: cloudstack
Updated Branches:
  refs/heads/agent-ipv6 [created] 12572e8a9


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/12572e8a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/12572e8a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/12572e8a

Branch: refs/heads/agent-ipv6
Commit: 12572e8a9dda68cf2e37003ff4eb33d810b7038a
Parents: 2a01fd4
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Tue Jul 15 09:05:04 2014 +0200
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Thu Jul 17 22:37:20 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/12572e8a/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) {