From 698e9104668452163aa3d083599d335b35f93aa2 Mon Sep 17 00:00:00 2001 From: remotetohome <178868468+remotetohome@users.noreply.github.com> Date: Thu, 5 Feb 2026 01:39:19 -0600 Subject: [PATCH] Fix IP sorting: use multiplication to avoid signed integer overflow --- templates/status.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/status.html b/templates/status.html index 2cc283e..5c9e332 100644 --- a/templates/status.html +++ b/templates/status.html @@ -37,7 +37,8 @@ Connected Peers // Extract IP from formats like "10.9.0.132/32" or "99.92.101.230:56078" const match = (ip || '').trim().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/); if (!match) return null; // Empty/invalid IPs will be sorted to bottom - return (parseInt(match[1]) << 24) + (parseInt(match[2]) << 16) + (parseInt(match[3]) << 8) + parseInt(match[4]); + // Use multiplication instead of bit shifting to avoid signed 32-bit integer issues + return (parseInt(match[1]) * 16777216) + (parseInt(match[2]) * 65536) + (parseInt(match[3]) * 256) + parseInt(match[4]); } function getSortValue(cell, sortType) {