Hello, it seems to be a logical mistake in smbclient. popt first retrieves the arguments, setting in case of the "-L" option the query_host variable. popt also retrieves in case of the "-I" option the argument and sets a boolean variable have_ip. In some operations of the smbclient there is the have_ip used like so: cli = cli_cm_open(talloc_tos(), NULL, have_ip ? dest_ss_str : desthost, service, auth_info, true, smb_encrypt, max_protocol, port, name_type); But in do_host_query it is done in that way: cli = cli_cm_open(talloc_tos(), NULL, query_host, "IPC$", auth_info, true, smb_encrypt, max_protocol, port, name_type); In this case smbclient just takes the argument of the "-L" parameter and tries to open that host, which also is successful, but failing because the ressource name is wrong: session request to *SMBSERVER failed (Called name not present) This is because do_host_query uses the ip address to connect to and as the netbios name of the remote server. The ip address does not match with the netbios name. Thus it is to confirm that smbclient ignores the -I option. cli_cm_open would need to have an extra parameter with the netbios name, so that it is possible to connect to an ip address but have set the correct ressource name.
This appears to have been fixed some time in or before 2011. -L now uses the same logic as elsewhere.