diff options
author | onefang | 2020-01-01 19:03:15 +1000 |
---|---|---|
committer | onefang | 2020-01-01 19:03:15 +1000 |
commit | 9c9226dced67b0e18fbc67cd31ccda585f39b322 (patch) | |
tree | 27c6ec94e318d1498909275940a86662e2fc67c0 /apt-panopticommon.lua | |
parent | Cut down on lower bandwidth files to HEAD check. (diff) | |
download | apt-panopticon-9c9226dced67b0e18fbc67cd31ccda585f39b322.zip apt-panopticon-9c9226dced67b0e18fbc67cd31ccda585f39b322.tar.gz apt-panopticon-9c9226dced67b0e18fbc67cd31ccda585f39b322.tar.bz2 apt-panopticon-9c9226dced67b0e18fbc67cd31ccda585f39b322.tar.xz |
Curl will try IPv4 as a backup if IPv6 fails, and we don't want that.
Tell it not to.
Also detect if IPv6 is even available.
Diffstat (limited to 'apt-panopticommon.lua')
-rw-r--r-- | apt-panopticommon.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index e40ec0a..7664297 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua | |||
@@ -23,6 +23,7 @@ APT.verbosity = -1 | |||
23 | APT.origin = false | 23 | APT.origin = false |
24 | APT.redir = false | 24 | APT.redir = false |
25 | APT.keep = false | 25 | APT.keep = false |
26 | APT.IPv46 = '' | ||
26 | 27 | ||
27 | APT.options = | 28 | APT.options = |
28 | { | 29 | { |
@@ -119,6 +120,10 @@ APT.parseArgs = function(args) | |||
119 | APT.args = args | 120 | APT.args = args |
120 | local arg = {} | 121 | local arg = {} |
121 | local sendArgs = "" | 122 | local sendArgs = "" |
123 | -- A special test to disable IPv6 tests if IPv6 isn't available. | ||
124 | if 1 == APT.exe('ip -6 addr | grep inet6 | grep " global"'):Do().status then | ||
125 | table.insert(args, '--tests=-IPv6') | ||
126 | end | ||
122 | if 0 ~= #(args) then | 127 | if 0 ~= #(args) then |
123 | local option = "" | 128 | local option = "" |
124 | for i, a in pairs(args) do | 129 | for i, a in pairs(args) do |
@@ -132,6 +137,9 @@ APT.parseArgs = function(args) | |||
132 | elseif "-q" == a then | 137 | elseif "-q" == a then |
133 | APT.verbosity = -1 | 138 | APT.verbosity = -1 |
134 | sendArgs = sendArgs .. a .. " " | 139 | sendArgs = sendArgs .. a .. " " |
140 | elseif ("-4" == a) or ("-6" == a) then | ||
141 | APT.IPv46 = a | ||
142 | sendArgs = sendArgs .. a .. " " | ||
135 | elseif "-k" == a then | 143 | elseif "-k" == a then |
136 | APT.keep = true | 144 | APT.keep = true |
137 | sendArgs = sendArgs .. a .. " " | 145 | sendArgs = sendArgs .. a .. " " |