diff --git a/src/srun/opt.c b/src/srun/opt.c
index 3da4cda52084cace9fe14610938005c4bb9f1c4c..f29c20bec1def393112be114370992282f53126c 100644
--- a/src/srun/opt.c
+++ b/src/srun/opt.c
@@ -1745,7 +1745,7 @@ static void _opt_args(int argc, char **argv)
 		if (_verbose)
 			command_pos += 2;
 		if (opt.ifname) {
-			if (parse_uint32(opt.ifname, &taskid)
+			if (!parse_uint32(opt.ifname, &taskid)
 			    && ((int) taskid < opt.ntasks)) {
 				command_pos += 2;
 			}