From 352e94a1339b957900ea3ba70d4d352bef021844 Mon Sep 17 00:00:00 2001 From: Venkat Chimata Date: Mon, 8 Dec 2025 16:10:10 +0530 Subject: [PATCH] ratelimit: generate shorter IFB names for phy-based interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Interfaces like phy6g-ap0 can produce overly long IFB device names (e.g., i-phy6g-ap0), which may exceed kernel name-length limits, specifically in case of VLANs. This patch normalizes such interface names by replacing the phy prefix with p and shortening ap → a, producing more compact IFB device names (e.g., i-p2g-a0). Other interfaces continue using their original names. Signed-off-by: Venkat Chimata --- feeds/ucentral/ratelimit/files/usr/bin/ratelimit | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/feeds/ucentral/ratelimit/files/usr/bin/ratelimit b/feeds/ucentral/ratelimit/files/usr/bin/ratelimit index abd18736c..c22ed6563 100755 --- a/feeds/ucentral/ratelimit/files/usr/bin/ratelimit +++ b/feeds/ucentral/ratelimit/files/usr/bin/ratelimit @@ -37,7 +37,19 @@ function qdisc_del(iface) { } function ifb_dev(iface) { - return "i-" + iface; + let ifbname; + + if ((index(iface, 'phy') != -1) && (index(iface, 'ap') != -1)) { + // For interfaces like phy6g-ap0, phy5g-ap0, phy2g-ap0 + // we replace 'phy' with "p" to confine the ifb name length + // and replace 'ap' with 'a' to further shorten it. + ifbname = replace(iface, 'phy', 'p'); + ifbname = replace(ifbname, 'ap', 'a'); + } else { + ifbname = iface; + } + ifbname = "i-" + ifbname; + return ifbname; } function ifb_add(iface, ifbdev) {