Package: apt-cacher-ng
Version: 3.6.4-1
Severity: normal
Tags: ipv6 upstream

Dear Maintainer,

apt-cacher-ng does not properly bind the network socket when the value of the 
BindAddress variable is a plain IPv6 address whose last group is a integer 
number (and could thus be interpreted as a port).

These do work as expected:
    BindAddress=127.0.0.1       -> binds to 127.0.0.1:3142
    BindAddress=127.0.0.1:8080  -> binds to 127.0.0.1:8080
    BindAddress=::abcd          -> binds to [::abcd]:3142
    BindAddress=[::abcd]:8080   -> binds to [::abcd]:8080
    BindAddress=[::1]:8080      -> binds to [::1]:8080

This does not work while it should:
    BindAddress=::1             -> binds to nothing but should be [::1]:3142

These do not work, but that may be intentional since the square bracket 
notation is only used in conjunction with a port:
    BindAddress=[::abcd]        -> binds to nothing, could be [::abcd]:3142
    BindAddress=[::1]           -> binds to nothing, could be [::1]:3142

When the last group is a integer, it gets cut off and used as a port:
    BindAddress=::abcd:1234     -> binds to [::abcd]:1234 but should be 
[::abcd:1234]:3142
    BindAddress=:::1            -> binds to [::]:1 but should throw an "invalid 
address" error

Plain IPv6 addresses worked fine on buster (also did on stretch and jessie), but not on bullseye 
anymore. The systemd service starts successfully but listens on no port/address. Depending on the 
BindAddress, the error message I got was either "Error resolving address for binding: Invalid 
argument" when the cut-off IPv6 address was invalid, or "Couldn't bind socket: Cannot 
assign requested address" when the cut-off IPv6 address was valid but no interface had it 
assigned. Raising the debug level did not turn up more information, but I did not try with a debug 
build. I think this issue is related to the new BindAddress port syntax and some parse-confusion 
with the colons.

In the meantime I am using the [IPv6]:Port syntax as a workaround, since that 
is working as expected in all cases.


-- Package-specific info:

-- System Information:
Debian Release: 11.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-8-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages apt-cacher-ng depends on:
ii  adduser                  3.118
ii  debconf [debconf-2.0]    1.5.77
ii  dpkg                     1.20.9
ii  libbz2-1.0               1.0.8-4
ii  libc6                    2.31-13
ii  libevent-2.1-7           2.1.12-stable-1
ii  libevent-pthreads-2.1-7  2.1.12-stable-1
ii  libgcc-s1                10.2.1-6
ii  liblzma5                 5.2.5-2
ii  libssl1.1                1.1.1k-1+deb11u1
ii  libstdc++6               10.2.1-6
ii  libsystemd0              247.3-6
ii  libwrap0                 7.6.q-31
ii  lsb-base                 11.1.0
ii  zlib1g                   1:1.2.11.dfsg-2

Versions of packages apt-cacher-ng recommends:
ii  ca-certificates  20210119

Versions of packages apt-cacher-ng suggests:
pn  avahi-daemon  <none>
pn  doc-base      <none>
pn  libfuse2      <none>

-- Configuration Files:
/etc/apt-cacher-ng/acng.conf changed [not included]
/etc/apt-cacher-ng/security.conf changed [not included]
/etc/cron.daily/apt-cacher-ng changed [not included]

-- debconf information:
  apt-cacher-ng/port: keep
  apt-cacher-ng/gentargetmode: No automated setup
  apt-cacher-ng/cachedir: keep
  apt-cacher-ng/bindaddress: keep
  apt-cacher-ng/proxy: keep
* apt-cacher-ng/tunnelenable: false

Reply via email to