Please add these patches to the next release


#1

Hi, I just updated my home router to the latest version of vyos and I found I still had to patch Vyos to suypport freedns and to dns forwarding.

Please can these patches be incorporated into the next standard release to make things easier next time.

thanks.

$ sudo su -
# curl -o ddclient.deb http://ftp.us.debian.org/debian/pool/main/d/ddclient/ddclient_3.8.2-2_all.deb
# dpkg -i ddclient.deb

# cat >/tmp/ddns-node.def.patch <<'EOL'
--- /opt/vyatta/share/vyatta-cfg/templates/service/dns/dynamic/interface/node.tag/service/node.def.orig
+++ /opt/vyatta/share/vyatta-cfg/templates/service/dns/dynamic/interface/node.tag/service/node.def
@@ -2,7 +2,7 @@
 help: Service being used for Dynamic DNS [REQUIRED]
 type: txt
 syntax:expression: exec "
-        service_array=(dnspark dslreports dyndns easydns namecheap sitelutions zoneedit)
+        service_array=(dnspark dslreports dyndns easydns freedns namecheap sitelutions zoneedit)
         service_array_len=${#service_array[*]}
         i=0
         while [ $i -lt $service_array_len ]; do
@@ -15,7 +15,7 @@
         exit 1 "

 allowed: local -a array ;
-         array=(dnspark dslreports dyndns easydns namecheap sitelutions zoneedit);
+         array=(dnspark dslreports dyndns easydns freedns namecheap sitelutions zoneedit);
          echo -n ${array[@]}

 commit:expression: $VAR(./@/login) != ""; "Set login for service $VAR(./@) to send DDNS updates for interface $VAR(../@)"
EOL

# patch -p0 < /tmp/ddns-node.def.patch

and the following for dns forwarding;

$ sudo su -
# cat >/tmp/dns_forwarding-node.patch <<'EOL'
--- /dev/null
+++ /opt/vyatta/share/vyatta-cfg/templates/service/dns/forwarding/options/node.def
@@ -0,0 +1,7 @@
+multi:
+type: txt
+# help formatted below to appear properly during tab completion
+help: Additional options for dns forwarding. You must 
+                use the syntax of dnsmasq.conf in this text-field. Using this 
+               without proper knowledge may result in a crashed dnsmaq daemon.
+               Check system log to look for errors.
EOL
# patch -p0 < /tmp/dns_forwarding-node.patch

# cat >/tmp/vyatta-dns-forwarding.pl.patch <<'EOL'
--- /opt/vyatta/sbin/vyatta-dns-forwarding.pl.orig
+++ /opt/vyatta/sbin/vyatta-dns-forwarding.pl
@@ -63,7 +63,7 @@
     my $output = '';
     my $config = new Vyatta::Config;
     my $use_dnsmasq_conf = 0;
-    my (@listen_interfaces, $cache_size, @use_nameservers, $use_system_nameservers, @use_dhcp_nameservers, @domain, $server, $ignore_hosts_file);
+    my (@listen_interfaces, $cache_size, @use_nameservers, $use_system_nameservers, @use_dhcp_nameservers, @options, @domain, $server, $ignore_hosts_file);

     $config->setLevel("service dns forwarding");

@@ -71,6 +71,7 @@
            @listen_interfaces = $config->returnOrigValues("listen-on");
            $cache_size = $config->returnOrigValue("cache-size");
            @use_nameservers = $config->returnOrigValues("name-server");
+           @options = $config->returnOrigValues("options");
            $use_system_nameservers = $config->existsOrig("system");
            @use_dhcp_nameservers = $config->returnOrigValues("dhcp");
            @domain = $config->listOrigNodes("domain");
@@ -80,6 +81,7 @@
            @listen_interfaces = $config->returnValues("listen-on");
            $cache_size = $config->returnValue("cache-size");
            @use_nameservers = $config->returnValues("name-server");
+           @options = $config->returnValues("options");
            $use_system_nameservers = $config->exists("system");
           @use_dhcp_nameservers = $config->returnValues("dhcp");
            @domain = $config->listNodes("domain");
@@ -148,6 +150,12 @@
         }
     }

+    if (@options != 0) {
+       foreach my $option (@options) {
+          $output .= "$option\n";
+       }
+    }
+
     if ($use_dnsmasq_conf == 1) {
         $output .= "resolv-file=/etc/dnsmasq.conf\n";
     }
EOL

# patch -p0 < /tmp/vyatta-dns-forwarding.pl.patch