From e55e0e470a27cc224502fd3969fc99de677fc13c Mon Sep 17 00:00:00 2001 From: Niklas Schnelle Date: Thu, 16 Apr 2026 14:05:37 +0200 Subject: [PATCH] opticsmon: Fix wrong JSON print for tx_fault MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "tx_fault" field in the JSON output accidentally contained the rx_los value instead of the tx_fault one. Change it to the correct value. Note that this does not impact the data relayed to firmware as that uses the raw module data. Fixes: c34adb9cabee ("opticsmon: Introduce opticsmon tool") Reviewed-by: Jan Höppner Signed-off-by: Niklas Schnelle Signed-off-by: Jan Höppner --- opticsmon/opticsmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opticsmon/opticsmon.c b/opticsmon/opticsmon.c index ebae75ad..5a52f8a8 100644 --- a/opticsmon/opticsmon.c +++ b/opticsmon/opticsmon.c @@ -143,7 +143,7 @@ static void optics_json_print(struct opticsmon_ctx *ctx, struct zpci_netdev *nd, util_fmt_pair(FMT_QUOTE, "type", optics_type_str(optics_type(oi))); util_fmt_pair(FMT_QUOTE, "rx_los", optics_los_str(optics_rx_los(oi))); util_fmt_pair(FMT_QUOTE, "tx_los", optics_los_str(optics_tx_los(oi))); - util_fmt_pair(FMT_QUOTE, "tx_fault", optics_los_str(optics_rx_los(oi))); + util_fmt_pair(FMT_QUOTE, "tx_fault", optics_los_str(optics_tx_fault(oi))); if (ctx->opts.module_info) module_info_pair(oi); util_fmt_obj_end();