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: mp+294189@code.launchpad.net

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.

[1]:
https://tools.ietf.org/html/rfc4007#section-11

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
=== modified file 'apt-avahi-discover'
--- apt-avahi-discover 2013-09-20 08:04:12 +0000
+++ apt-avahi-discover 2016-05-10 05:42:18 +0000
@@ -83,10 +83,12 @@
83 addr = tokens[7]83 addr = tokens[7]
84 port = int(tokens[8])84 port = int(tokens[8])
85 if is_ipv6(addr):85 if is_ipv6(addr):
86 # We need to skip ipv6 link-local addresses since 86 # Link-local IPv6 addresses must be scoped by interface,
87 # APT can't use them87 # otherwise they are not usable.
88 if not is_linklocal(addr):88 if is_linklocal(addr):
89 addr6.append((addr, port))89 iface = tokens[1]
90 addr = "{addr}%{iface}".format(addr=addr, iface=iface)
91 addr6.append((addr, port))
90 else:92 else:
91 addr4.append((addr, port))93 addr4.append((addr, port))
9294

Subscribers

People subscribed via source and target branches

to all changes: