[Resolvconf-devel] Bug#705582: Please add option PREFER_IPV6
Thomas Hood
jdthood at gmail.com
Wed Apr 17 07:13:37 UTC 2013
Package: resolvconf
Version: 1.71
Severity: wishlist
---------- Forwarded message ----------
From: Pali Rohár <pali.rohar at gmail.com>
Date: Sun, Apr 14, 2013 at 8:31 PM
Subject: [Resolvconf-devel] [PATCH] Add option PREFER_IPV6
To: resolvconf-devel at 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.rohar at gmail.com
_______________________________________________
Resolvconf-devel mailing list
Resolvconf-devel at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/resolvconf-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/resolvconf-devel/attachments/20130417/6ae84a4f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/resolvconf-devel/attachments/20130417/6ae84a4f/attachment.pgp>
More information about the Resolvconf-devel
mailing list