You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/02/26 19:51:34 UTC

[6/24] git commit: refs/heads/ui-regions - CLOUDSTACK-1332: Enable IPv6 dns in VR

CLOUDSTACK-1332: Enable IPv6 dns in VR


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

Branch: refs/heads/ui-regions
Commit: a1b33cadf571f518ad7ff6da1ef8de947b12b381
Parents: cf90b6c
Author: Sheng Yang <sh...@citrix.com>
Authored: Mon Feb 25 19:02:59 2013 -0800
Committer: Sheng Yang <sh...@citrix.com>
Committed: Mon Feb 25 19:12:15 2013 -0800

----------------------------------------------------------------------
 .../debian/config/etc/init.d/cloud-early-config    |   42 +++++++++++---
 1 files changed, 33 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a1b33cad/patches/systemvm/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
index 78231fb..8ddccd5 100755
--- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config
+++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
@@ -363,6 +363,18 @@ setup_common() {
     echo "nameserver $NS2" >> /etc/dnsmasq-resolv.conf
     echo "nameserver $NS2" >> /etc/resolv.conf
   fi
+
+  if [ -n "$IP6_NS1" ]
+  then
+    echo "nameserver $IP6_NS1" >> /etc/dnsmasq-resolv.conf
+    echo "nameserver $IP6_NS1" >> /etc/resolv.conf
+  fi
+  if [ -n "$IP6_NS2" ]
+  then
+    echo "nameserver $IP6_NS2" >> /etc/dnsmasq-resolv.conf
+    echo "nameserver $IP6_NS2" >> /etc/resolv.conf
+  fi
+
   if [ -n "$MGMTNET"  -a -n "$LOCAL_GW" ]
   then
     ip route add $MGMTNET via $LOCAL_GW dev eth1
@@ -453,17 +465,23 @@ setup_dnsmasq() {
   fi
   sed -i -e "/^[#]*dhcp-option=option:router.*$/d" /etc/dnsmasq.conf
   [ $DEFAULT_GW ] && echo "dhcp-option=option:router,$DEFAULT_GW" >> /etc/dnsmasq.conf
-  NS=$NS1
-  [ -n "$NS2" ] && NS=$NS1,$NS2
-    #for now set up ourself as the dns server as well
-  sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf
-  if [ "$USE_EXTERNAL_DNS" == "true" ]
+
+  [ $ETH0_IP ] && [ $NS1 ] && NS="$NS1,"
+  [ $ETH0_IP ] && [ $NS2 ] && NS="$NS$NS2,"
+  [ $ETH0_IP6 ] && [ $IP6_NS1 ] && NS6="[$IP6_NS1],"
+  [ $ETH0_IP6 ] && [ $IP6_NS2 ] && NS6="$NS6[$IP6_NS2],"
+  #for now set up ourself as the dns server as well
+  sed -i -e "/^[#]*dhcp-option=6,.*$/d" /etc/dnsmasq.conf
+  sed -i -e "/^[#]*dhcp-option=option6:dns-server,.*$/d" /etc/dnsmasq.conf
+  if [ "$USE_EXTERNAL_DNS" != "true" ]
   then
-    [ $ETH0_IP ] && echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf
-  else
-    [ $ETH0_IP ] && echo "dhcp-option=6,$INTERNAL_DNS,$NS" >> /etc/dnsmasq.conf
+    [ $ETH0_IP ] && NS="$INTERNAL_DNS,$NS"
+    [ $ETH0_IP6 ] && NS6="[::],$NS6"
   fi
-  [ $ETH0_IP6 ] && echo "dhcp-option=option6:dns-server,[::]" >> /etc/dnsmasq.conf
+  NS=${NS%?}
+  NS6=${NS6%?}
+  [ $ETH0_IP ] && echo "dhcp-option=6,$NS" >> /etc/dnsmasq.conf
+  [ $ETH0_IP6 ] && echo "dhcp-option=option6:dns-server,$NS6" >> /etc/dnsmasq.conf
 }
 
 setup_sshd(){
@@ -960,6 +978,12 @@ for i in $CMDLINE
       dns2)
           NS2=$VALUE
           ;;
+      ip6dns1)
+          IP6_NS1=$VALUE
+          ;;
+      ip6dns2)
+          IP6_NS2=$VALUE
+          ;;
       domain)
           DOMAIN=$VALUE
           ;;