git: 3e297e9e5532 - main - libifconfig: Fix SFP table generators for Lua 5.5

From: Ryan Moeller <rmoeller_at_FreeBSD.org>
Date: Sat, 14 Nov 2026 14:30:41 UTC
The branch main has been updated by rmoeller:

URL: https://cgit.FreeBSD.org/src/commit/?id=3e297e9e5532aee36a77d57627915755afd8118f

commit 3e297e9e5532aee36a77d57627915755afd8118f
Author:     Ryan Moeller <rmoeller@FreeBSD.org>
AuthorDate: 2026-11-13 07:13:47 +0000
Commit:     Ryan Moeller <rmoeller@FreeBSD.org>
CommitDate: 2026-11-14 14:26:25 +0000

    libifconfig: Fix SFP table generators for Lua 5.5
    
    This fixes Lua 5.5 compat in the .c template, where the first loop
    variable '_' becomes const in Lua 5.5.  Use select() to discard inside
    the loop instead.
    
    While here, fix a mismatched variable name in the corresponding header
    template.
    
    Reported by:    Austin Horstman <khaneliman12@gmail.com>
    Reviewed by:    kevans
    Approved by:    kevans (mentor)
    Closes:         https://github.com/freebsd/freebsd-src/pull/2473
    Differential Revision:  https://reviews.freebsd.org/D61455
---
 lib/libifconfig/libifconfig_sfp_tables.tpl.c | 2 +-
 lib/libifconfig/libifconfig_sfp_tables.tpl.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libifconfig/libifconfig_sfp_tables.tpl.c b/lib/libifconfig/libifconfig_sfp_tables.tpl.c
index f59d86a2d390..bb1afeba50e1 100644
--- a/lib/libifconfig/libifconfig_sfp_tables.tpl.c
+++ b/lib/libifconfig/libifconfig_sfp_tables.tpl.c
@@ -60,7 +60,7 @@ for _, ent in ipairs(enums) do
 static const struct sfp_enum_metadata {*name*}_table_[] = {
 {%
         for _, item in ipairs(enum.values) do
-            _, sym, desc, disp = table.unpack(item)
+            sym, desc, disp = select(2, table.unpack(item))
             local symbol = string.upper(name).."_"..sym
 %}
 	{
diff --git a/lib/libifconfig/libifconfig_sfp_tables.tpl.h b/lib/libifconfig/libifconfig_sfp_tables.tpl.h
index b89d10575110..e1dfac07ec7a 100644
--- a/lib/libifconfig/libifconfig_sfp_tables.tpl.h
+++ b/lib/libifconfig/libifconfig_sfp_tables.tpl.h
@@ -41,7 +41,7 @@ for _, ent in ipairs(enums) do
     else
         local enum = ent
         local name = "sfp_"..enum.name
-        local num, sym, desc, disp
+        local val, sym, desc, disp
 %}
 /** {*enum.description*} */
 enum {*name*} {