<div dir="ltr">Package: resolvconf<div>Version: 1.71</div><div>Severity: wishlist<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Pali Rohár</b> <span dir="ltr"><<a href="mailto:pali.rohar@gmail.com">pali.rohar@gmail.com</a>></span><br>

Date: Sun, Apr 14, 2013 at 8:31 PM<br>Subject: [Resolvconf-devel] [PATCH] Add option PREFER_IPV6<br>To: <a href="mailto:resolvconf-devel@lists.alioth.debian.org">resolvconf-devel@lists.alioth.debian.org</a><br><br>Hello,<br>


<br>
I created small patch which adding new env option PREFER_IPV6.<br>
When is set to YES then libc resolvconf updater will add ipv6<br>
nameservers before ipv4 in /etc/resolv.conf. This is usefull if<br>
you want to prefer using nameservers via ipv6 protocol.<br>
<br>
Patch was generated against ubuntu resolvconf version 1.67ubuntu2.<br>
<br>
--- etc/resolvconf/update.d/libc.orig   2013-04-02 15:27:34.017686814 +0200<br>
+++ etc/resolvconf/update.d/libc        2013-04-02 15:37:55.121668638 +0200<br>
@@ -87,6 +87,21 @@ uniquify()<br>
        done<br>
 }<br>
<br>
+ipv6_nameserver_list()<br>
+{<br>
+       while [ "$1" ] ; do<br>
+               case "$1" in (*:*) : ;; (*) shift ; continue ;; esac<br>
+               for E in $NMSRVRS ; do<br>
+                       [ "$1" = "$E" ] && { shift ; continue 2 ; }<br>
+               done<br>
+               NMSRVRS="${NMSRVRS:+$NMSRVRS }$1"<br>
+               case "$TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS" in (y|Y|yes|YES|Yes) case "$1" in (127.*|::1) return 0 ;;<br>
esac ;; esac<br>
+               N=$(($N + 1))<br>
+               [ "$N" = 3 ] && return 0<br>
+               shift<br>
+       done<br>
+}<br>
+<br>
 # Args are candidate items not containing spaces<br>
 # Returns NSMSRVS -- space-separate list of no more than 3 items,<br>
 #                    without duplicates,<br>
@@ -95,6 +110,7 @@ uniquify_nameserver_list()<br>
 {<br>
        NMSRVRS=""<br>
        N=0<br>
+       case "$PREFER_IPV6" in (y|Y|yes|YES|Yes) ipv6_nameserver_list "$@" ;; esac<br>
        while [ "$1" ] ; do<br>
                for E in $NMSRVRS ; do<br>
                        [ "$1" = "$E" ] && { shift ; continue 2 ; }<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Pali Rohár<br>
<a href="mailto:pali.rohar@gmail.com">pali.rohar@gmail.com</a><br>
</font></span><br>_______________________________________________<br>
Resolvconf-devel mailing list<br>
<a href="mailto:Resolvconf-devel@lists.alioth.debian.org">Resolvconf-devel@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/resolvconf-devel" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/resolvconf-devel</a><br></div><br></div></div>