Project

General

Profile

Actions

Bug #16930

open

SqStat real-time traffic view truncates IPv6 addresses at first colon ([2001) and groups all connections together

Added by Jonathan Lee about 8 hours ago. Updated about 8 hours ago.

Status:
New
Priority:
Normal-package
Assignee:
-
Category:
Squid
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
All
Affected Plus Version:
26.11
Affected Architecture:
All

Description

Subject
SqStat real-time traffic view truncates IPv6 addresses at first colon ([2001) and groups all connections together

Description

Overview:
When monitoring real-time active proxy connections via SqStat, client devices using IPv6 addresses are not parsed correctly. Instead of listing unique individual IPv6 client hosts, the interface truncates the address string at the first colon. This causes all active global IPv6 traffic across the entire network to bundle together under a single, broken header entry labeled "[2001".

Steps to Reproduce:
1. Enable IPv6 routing on the local area network.
2. Direct client traffic through the Squid proxy using IPv6 destinations.
3. Open the real-time SqStat traffic monitoring interface.
4. Observe the client host mapping field.

Expected Behavior:
Each unique, full IPv6 address (e.g., [2001:db8:1:1::15]) should be recognized as a distinct client host and displayed in its own dedicated section with its respective connections.

Actual Behavior:
The parser clips the string at the first colon delimiter. It leaves a single hanging open bracket [ and the first block of the address (typically 2001). Every single separate client device using an IPv6 address is forced into this exact same section, making it impossible to see individual device usage or connection counts.

Root Cause Analysis:
The issue lies within the legacy string tokenization logic in the backend parser files (specifically inside sqstat.class.php or its accompanying parsing library). The code uses string operations like explode(':', $address) or simple regex matches designed strictly for IPv4 (IP:PORT). Because IPv6 natively utilizes colons as internal address block separators rather than just a port delimiter, the parser splits the IP address string itself rather than isolating the port at the end.

Suggested Fix / Remediation:
The backend logic needs to be updated to support bracket-enclosed IPv6 hosts or to split string delimiters from right-to-left.

  • Replace basic explode logic with a regex check that accounts for bracket structures: ^\[(.*)\]:([0-9]+)$
  • Alternatively, isolate the port by targeting only the last colon in the string using native PHP array tools:
$pos = strrpos($address, ':');
// Extract the IP and Port based on the last colon position instead of the first

Files

Screenshot 2026-07-02 at 08.37.21.png (573 KB) Screenshot 2026-07-02 at 08.37.21.png Jonathan Lee, 07/02/2026 03:43 PM
sqstat.class.php (19.1 KB) sqstat.class.php patched file that fixes issue so it will show correctly Jonathan Lee, 07/02/2026 04:06 PM
Screenshot 2026-07-02 at 09.07.09.png (583 KB) Screenshot 2026-07-02 at 09.07.09.png how it should or how would like it to show after patch Jonathan Lee, 07/02/2026 04:07 PM
Actions

Also available in: Atom PDF