Merge lp:~mpontillo/squid-deb-proxy/possible-ipv6-fix into lp:squid-deb-proxy

Proposed by Mike Pontillo
Status: Needs review
Proposed branch: lp:~mpontillo/squid-deb-proxy/possible-ipv6-fix
Merge into: lp:squid-deb-proxy
Diff against target: 19 lines (+6/-4)
1 file modified
apt-avahi-discover (+6/-4)
To merge this branch: bzr merge lp:~mpontillo/squid-deb-proxy/possible-ipv6-fix
Reviewer Review Type Date Requested Status
squid-deb-proxy-developers Pending
Review via email:

Commit message

Qualify IPv6 link-local addresses with interface scope.

Description of the change

This is a (possible) fix for the "link-local addresses unusable with apt" issue that was noted in the source code to apt-avahi-discover.

In most cases (even when only one interface exists on the system), IPv6 link-local addresses are not usable unless scoped with an interface name. See RFC 4007 section 11 for more details.[1]

Linux uses interface names as zone_id values, so all we need to do (in theory) is append "%<interface-name>" to the link-local address.

I have not tested this yet, but I am in the process of setting up an IPv6-only test environment due to a customer requirement, so I may get a chance to test it in the coming weeks/months.


To post a comment you must log in.

Unmerged revisions

141. By Mike Pontillo

Qualify link-local addresses with interface scope.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apt-avahi-discover'
2--- apt-avahi-discover 2013-09-20 08:04:12 +0000
3+++ apt-avahi-discover 2016-05-10 05:42:18 +0000
4@@ -83,10 +83,12 @@
5 addr = tokens[7]
6 port = int(tokens[8])
7 if is_ipv6(addr):
8- # We need to skip ipv6 link-local addresses since
9- # APT can't use them
10- if not is_linklocal(addr):
11- addr6.append((addr, port))
12+ # Link-local IPv6 addresses must be scoped by interface,
13+ # otherwise they are not usable.
14+ if is_linklocal(addr):
15+ iface = tokens[1]
16+ addr = "{addr}%{iface}".format(addr=addr, iface=iface)
17+ addr6.append((addr, port))
18 else:
19 addr4.append((addr, port))


People subscribed via source and target branches

to all changes: