smbc_open_fn and smbc_stat_fn, other function always set ETIMEDOUT when connect failure. Therefore, we could not determine connection refused and actual connection timed. I created patch that libsmbclient return ECONNREFUSED when connection refused. Thanks.
Created attachment 6241 [details] patch for 3.2
Created attachment 6242 [details] patch for 3.5