first, last, step and pair (--cable-test-tdr) take a value, but their parser entries leave min_argc at 0. Given as the last word on the line, the value handler reads the NULL that ends argv and the error message prints it: # ethtool --cable-test-tdr eth0 first 1 last ethtool (--cable-test-tdr): invalid value '(null)' for parameter 'last' Set min_argc to 1, as every other value-taking parameter does, so the parser reports the missing value itself: # ethtool --cable-test-tdr eth0 first 1 last ethtool (--cable-test-tdr): no value for parameter 'last' Only the message changes: the exit status was already 1 and no request was sent. Fixes: 9561db9b76f4 ("Add cable test TDR support") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Dave Seddon --- netlink/cable_test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netlink/cable_test.c b/netlink/cable_test.c index fdb046e..648bf74 100644 --- a/netlink/cable_test.c +++ b/netlink/cable_test.c @@ -544,24 +544,28 @@ static const struct param_parser tdr_params[] = { .type = ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST, .group = ETHTOOL_A_CABLE_TEST_TDR_CFG, .handler = nl_parse_direct_m2cm, + .min_argc = 1, }, { .arg = "last", .type = ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST, .group = ETHTOOL_A_CABLE_TEST_TDR_CFG, .handler = nl_parse_direct_m2cm, + .min_argc = 1, }, { .arg = "step", .type = ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP, .group = ETHTOOL_A_CABLE_TEST_TDR_CFG, .handler = nl_parse_direct_m2cm, + .min_argc = 1, }, { .arg = "pair", .type = ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR, .group = ETHTOOL_A_CABLE_TEST_TDR_CFG, .handler = nl_parse_direct_u8, + .min_argc = 1, }, {} }; -- 2.56.0