Your message dated Sun, 15 Nov 2026 12:03:07 +0000
with message-id <[email protected]>
and subject line Bug#1153378: fixed in brltty 6.7-3.1+deb13u5
has caused the Debian Bug report #1153378,
regarding libbrlapi0.8: IPv6 localhost timeout misses ::1; X11 login stalls for 
134 seconds
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1153378: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1153378
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libbrlapi0.8
Version: 6.9.1+repack-2
Severity: normal
Tags: patch ipv6
Control: affects -1 xbrlapi


Dear Maintainer,

The localhost timeout fix used to close Debian bug #1087173 appears incomplete for IPv6. With libbrlapi0.8 and xbrlapi 6.9.1+repack-2 installed, xbrlapi still blocks an X11 login for approximately 134 seconds while connecting to [::1]:4101.

Related report: https://bugs.debian.org/1087173

Expected behaviour
------------------
If no BrlAPI server is available, a localhost connection should fail promptly,
with the existing short timeout covering IPv6 loopback as well as IPv4. An
unavailable optional braille helper should not delay the desktop for minutes.

Observed behaviour and configuration
------------------------------------
The system runs Debian forky/sid on amd64, using SDDM and Plasma X11. The brltty
package is not installed and there is no local braille daemon listening.

/etc/X11/Xsession.d/90xbrlapi runs xbrlapi synchronously, before Plasma starts,
and suppresses its stderr. xbrlapi attempts its BrlAPI connection before
backgrounding. During the delay, the helper was observed blocked in connect()
to [::1]:4101, with the TCP socket in SYN_SENT.

The persistent IPv6-disable configuration includes:

    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    net.ipv6.conf.enp2s0.disable_ipv6 = 1
    net.ipv6.conf.wlp3s0.disable_ipv6 = 1

The actual runtime state, also checked after the successful workaround test, is:

    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    net.ipv6.conf.enp2s0.disable_ipv6 = 0

Thus IPv6 loopback is disabled but Ethernet has IPv6 enabled. I have not
established which component re-enabled IPv6 on Ethernet. In this state,
"ip -6 route get ::1" selects the Ethernet default gateway rather than a local
loopback route. The unanswered connection waits for TCP retries to expire.
Regardless of this unusual network state, this is the kind of slow localhost
connection that the existing 100 ms timeout was intended to bound.

Measurements made before installing the workaround:

    Default xbrlapi connection:             134.465 seconds, then failure
    xbrlapi -b 127.0.0.1:                     0.008 seconds, connection refused     Workaround followed by real 90xbrlapi:    0.010 seconds, shell exit status 0

The original suspicion was external-monitor probing, because the problem was
noticed with an external monitor attached. Xorg successfully read the EDIDs,
however, and live xrandr queries completed in 0.010-0.017 seconds. The blocking
BrlAPI connection provides a direct explanation of the measured login delay;
I have not established that an external monitor is required to trigger it.

The journal supplies an end-to-end comparison using the same two events:

    Before workaround, seconds since boot:
         88.040221  SDDM starts /etc/sddm/Xsession /usr/bin/startplasma-x11
        224.262690  Started plasma-plasmashell.service
        Difference: 136.222469 seconds

    After workaround, a fresh login in the same boot:
        366939.047430  SDDM starts /etc/sddm/Xsession /usr/bin/startplasma-x11
        366941.425568  Started plasma-plasmashell.service
        Difference: 2.378138 seconds

The fresh login was successful and the long delay disappeared. These intervals
measure session launch to the plasmashell service being started, rather than
the time until every desktop application has finished loading.

Suspected cause and proposed correction
---------------------------------------
The installed changelog says 6.9.1+repack-2 includes git-localhost-timeout,
closing #1087173. I also checked that exact Debian version's packaging archive:

https://deb.debian.org/debian/pool/main/b/brltty/brltty_6.9.1+repack-2.debian.tar.xz
SHA256: 4d4bfdbcd3fd749371f87e2f4be1f7eb9992aa990cc130ef1a49271762c98d1d

In Programs/brlapi_client.c, the IPv6 branch of the added localhost guard uses:

    !memcmp(cur->ai_addr, &ip6_localhost, sizeof(ip6_localhost))

cur->ai_addr points to a struct sockaddr_in6, starting with the address family, port, and flow information. The comparison should instead start at sin6_addr.
As written, ::1 is not recognized and the short SO_SNDTIMEO is not installed
for that connection. This appears to explain why the supposedly fixed version
still waits for the full IPv6 TCP connection timeout.

The attached candidate patch (suggestion) changes the first argument to:

    &((struct sockaddr_in6 *)cur->ai_addr)->sin6_addr

It preserves the existing IPv4 check and timeout duration.

The attached standalone C reproducer checks the existing and corrected guards
using numeric addresses and port 4101, without opening network connections.
It was compiled with -std=c11 -D_POSIX_C_SOURCE=200112L -Wall -Wextra -Werror
and produced:

    ::1          original=0 corrected=1
    2001:db8::1  original=0 corrected=0
    127.0.0.1    original=1 corrected=1
    127.0.0.2    original=1 corrected=1
    192.0.2.1    original=0 corrected=0

This validates the address-comparison correction. I have not rebuilt or tested
a complete BrlAPI library with the candidate patch; the confirmed desktop
login test used the environment workaround below.

Reproduction on an affected system
----------------------------------
With the network state above, no listening BrlAPI server, and the reported
package versions, run from an X11 session:

    time timeout 5s env -u BRLAPI_HOST xbrlapi
    time timeout 5s env BRLAPI_HOST=127.0.0.1 xbrlapi

The first command reaches the five-second limit (exit status 124). The IPv4
command returns promptly with a connection error, which is expected with no
server. The earlier 134.465-second measurement allowed the default connection
to run to completion instead of imposing this five-second limit.

I rechecked these bounded commands after the successful login: the default
connection was stopped after 5.003 seconds with status 124; the IPv4 connection
returned after 0.011 seconds with status 4 and the following stderr:

    openConnection: Connection refused
    cannot connect to braille devices daemon brltty at 127.0.0.1

Working local workaround
------------------------
I installed /etc/X11/Xsession.d/89blp-brlapi-local, sourced before 90xbrlapi:

    if [ -z "${BRLAPI_HOST:-}" ]; then
      export BRLAPI_HOST=127.0.0.1
    fi

This preserves an explicitly configured nonempty BrlAPI host. The default
IPv4 connection is refused immediately and Xsession continues. IPv6 settings
were left unchanged. An alternative sysctl drop-in to enable IPv6 loopback
remains commented out and was not activated.

Versions
--------
    xbrlapi                  6.9.1+repack-2
    libbrlapi0.8:amd64        6.9.1+repack-2
    brltty                   not installed
    libc6:amd64              2.43-6
    sddm                     0.21.0+git20250502.4fe234b-2
    plasma-workspace         4:6.5.2-1
    xserver-xorg-core        2:21.1.20-1
    Kernel                   Linux 6.16.12+deb14+1-amd64

Since #1087173 is archived, I am filing this against libbrlapi0.8 with xbrlapi
marked as affected. Please link or reopen the earlier report if that is more
appropriate. Thank you for looking into it.
Description: Compare the IPv6 address field when applying the localhost timeout
 The existing guard compares the sockaddr_in6 header to an in6_addr, so it
 does not recognize ::1 and never sets the short timeout for IPv6 loopback.
 Compare sin6_addr instead, preserving the IPv4 test and the existing timeout.
Origin: other, locally prepared candidate correction
Bug-Debian: https://bugs.debian.org/1087173
Last-Update: 2026-11-07

--- a/Programs/brlapi_client.c
+++ b/Programs/brlapi_client.c
@@ -935,7 +935,7 @@
 	    && (ntohl(((struct sockaddr_in *)cur->ai_addr)->sin_addr.s_addr) & IN_CLASSA_NET)
 	      == (INADDR_LOOPBACK & IN_CLASSA_NET))
 	  || (cur->ai_family == AF_INET6
-	    && !memcmp(cur->ai_addr, &ip6_localhost, sizeof(ip6_localhost)))) {
+	    && !memcmp(&((struct sockaddr_in6 *)cur->ai_addr)->sin6_addr, &ip6_localhost, sizeof(ip6_localhost)))) {
 	/* Local connection, it should be fast, otherwise it means we have a
 	 * firewall blocking us, and then better not wait unnecessarily. */
 	struct timeval tv = { .tv_usec = 100000 };
/* Standalone check of the localhost predicate in git-localhost-timeout.
 * No sockets are opened and no network configuration is changed.
 */
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

static int is_localhost(const struct addrinfo *cur, int corrected) {
  const struct in6_addr ip6_localhost = IN6ADDR_LOOPBACK_INIT;

  return (cur->ai_family == AF_INET
          && (ntohl(((struct sockaddr_in *)cur->ai_addr)->sin_addr.s_addr) & IN_CLASSA_NET)
             == (INADDR_LOOPBACK & IN_CLASSA_NET))
         || (cur->ai_family == AF_INET6
             && !memcmp(corrected ? (const void *)&((struct sockaddr_in6 *)cur->ai_addr)->sin6_addr
                                  : (const void *)cur->ai_addr,
                        &ip6_localhost, sizeof(ip6_localhost)));
}

int main(void) {
  static const struct {
    const char *host;
    int original_expected;
    int corrected_expected;
  } cases[] = {
    {"::1", 0, 1},
    {"2001:db8::1", 0, 0},
    {"127.0.0.1", 1, 1},
    {"127.0.0.2", 1, 1},
    {"192.0.2.1", 0, 0},
  };
  const struct addrinfo hints = {.ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, .ai_flags = AI_NUMERICHOST | AI_NUMERICSERV};
  int failed = 0;

  for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
    struct addrinfo *address = NULL;
    int error = getaddrinfo(cases[i].host, "4101", &hints, &address);
    if (error) {
      fprintf(stderr, "%s: %s\n", cases[i].host, gai_strerror(error));
      return EXIT_FAILURE;
    }
    int original = is_localhost(address, 0);
    int corrected = is_localhost(address, 1);
    printf("%-12s original=%d corrected=%d\n", cases[i].host, original, corrected);
    failed |= original != cases[i].original_expected || corrected != cases[i].corrected_expected;
    freeaddrinfo(address);
  }
  return failed ? EXIT_FAILURE : EXIT_SUCCESS;
}

--- End Message ---
--- Begin Message ---
Source: brltty
Source-Version: 6.7-3.1+deb13u5
Done: Samuel Thibault <[email protected]>

We believe that the bug you reported is fixed in the latest version of
brltty, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Samuel Thibault <[email protected]> (supplier of updated brltty package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 14 Nov 2026 21:59:38 +0100
Source: brltty
Architecture: source
Version: 6.7-3.1+deb13u5
Distribution: trixie
Urgency: medium
Maintainer: Debian Accessibility Team <[email protected]>
Changed-By: Samuel Thibault <[email protected]>
Closes: 1153378
Changes:
 brltty (6.7-3.1+deb13u5) trixie; urgency=medium
 .
   * patches/git-localhost-timeout2: Fix connections to localhost for IPv6
     (Closes: Bug#1153378)
Checksums-Sha1:
 e582999a3ea3f68e855e7574f5705efb907f3ca7 3342 brltty_6.7-3.1+deb13u5.dsc
 c27fca4836dbba9efa2560897e456e7fb35d5eaf 41716 
brltty_6.7-3.1+deb13u5.debian.tar.xz
 da661fdc290083d1b2fbd480fca1ff4bf788cca5 17987 
brltty_6.7-3.1+deb13u5_source.buildinfo
Checksums-Sha256:
 092b7c78086dea00fd7819f792c1a95109571b81ca3fe4be433c1b7f463b34dc 3342 
brltty_6.7-3.1+deb13u5.dsc
 af1eb9193066b369d8eb2c522940e79d31ff9932fd355a92f376bd619b56375b 41716 
brltty_6.7-3.1+deb13u5.debian.tar.xz
 12443b1de734ba2966aec60dc9f57d4c69f4cffdd1974b840f951ee9a5f14a3b 17987 
brltty_6.7-3.1+deb13u5_source.buildinfo
Files:
 709e7e78daa5c32343279b33be575b4b 3342 admin optional brltty_6.7-3.1+deb13u5.dsc
 63482b4b3db1d7742860c5747f52a628 41716 admin optional 
brltty_6.7-3.1+deb13u5.debian.tar.xz
 162003c0c82c5b853f70f4fb31ae2803 17987 admin optional 
brltty_6.7-3.1+deb13u5_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEDHkkXhaQVdLZstA3O2TU75284AwFAmr4zvsACgkQO2TU7528
4AwRQw//VmRNOZTKGMBWGwvno+jf6S4nvVBQk39lW7AgqSBV5mpq45j9+uu4jlXY
xYtFu82Ek9ki0UF78EDq3UUBFY5fvr9QUJ7eQtLDv3rW0yQipjvGfqA5p5WxsCMw
pyzr5xO0YXqBiDLfVm8QZR6sXSqKKg7glezvRO69o21tC9QJ5qi0KkBzGchvNuVD
rv2nSRoxtKiF6nmyxZoK1bzGGxbO3w7lypuM8CA7E1AFw/NQHAXEu2iSbG1OCA+J
iTqocbfwp7DXECLJmYp28jmY1Ow1+ipCOrNB/TbHrGqEmwOWSK4Kp+vDHhsoieuw
ki2pxrxbyD39fiMXvSwR24zdnloycVk8C3XLRqVdJXBdTty2vOhDJdcuyjqAj8ut
wUdcfPk38gDxRY5Of5gRXULlGiKR0HgQoI/y0MnMdJN2QVL1Ch6E40g7HWkZI9Go
5VjTQE2BOFWjxxJMhaBKUUJDVEUIEGyfRye+Te8DM9hj1wgTtsD5lqLjxfYKDWhv
2Bbs7QyjjBEJVs4d9N7ejHSWNPFED2skKsouFW6xotQpmoyM4hqHY25cbE0jxbge
0z+ertngp9dE18fe/Wv+hDO1oaO0IpgdL2a8GjQ1gl5B4919mBwhPXpSKKYKBVag
T75Mee1qUQuQEt1ifJVVSbfQR63xm5fQ91szdAqDeOiBGKGxAeo=
=gZkH
-----END PGP SIGNATURE-----

Attachment: pgpvT5j0tAz3g.pgp
Description: PGP signature


--- End Message ---

Reply via email to