Package: resolvconf Version: 1.71 Severity: wishlist ---------- Forwarded message ---------- From: Pali Rohár <pali.ro...@gmail.com> Date: Sun, Apr 14, 2013 at 8:31 PM Subject: [Resolvconf-devel] [PATCH] Add option PREFER_IPV6 To: resolvconf-de...@lists.alioth.debian.org
Hello, I created small patch which adding new env option PREFER_IPV6. When is set to YES then libc resolvconf updater will add ipv6 nameservers before ipv4 in /etc/resolv.conf. This is usefull if you want to prefer using nameservers via ipv6 protocol. Patch was generated against ubuntu resolvconf version 1.67ubuntu2. --- etc/resolvconf/update.d/libc.orig 2013-04-02 15:27:34.017686814 +0200 +++ etc/resolvconf/update.d/libc 2013-04-02 15:37:55.121668638 +0200 @@ -87,6 +87,21 @@ uniquify() done } +ipv6_nameserver_list() +{ + while [ "$1" ] ; do + case "$1" in (*:*) : ;; (*) shift ; continue ;; esac + for E in $NMSRVRS ; do + [ "$1" = "$E" ] && { shift ; continue 2 ; } + done + NMSRVRS="${NMSRVRS:+$NMSRVRS }$1" + case "$TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS" in (y|Y|yes|YES|Yes) case "$1" in (127.*|::1) return 0 ;; esac ;; esac + N=$(($N + 1)) + [ "$N" = 3 ] && return 0 + shift + done +} + # Args are candidate items not containing spaces # Returns NSMSRVS -- space-separate list of no more than 3 items, # without duplicates, @@ -95,6 +110,7 @@ uniquify_nameserver_list() { NMSRVRS="" N=0 + case "$PREFER_IPV6" in (y|Y|yes|YES|Yes) ipv6_nameserver_list "$@" ;; esac while [ "$1" ] ; do for E in $NMSRVRS ; do [ "$1" = "$E" ] && { shift ; continue 2 ; } -- Pali Rohár pali.ro...@gmail.com _______________________________________________ Resolvconf-devel mailing list resolvconf-de...@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/resolvconf-devel
signature.asc
Description: PGP signature