[sane-devel] Net Client Not Contacting Server

C. Cook c.a.cook at quantum-sci.com
Wed Sep 9 18:29:03 BST 2020


On 2020-09-09 09:42, Ralph Little wrote:
> Hi,
>
> On Wed, Sep 9, 2020 at 8:39 AM C. Cook <c.a.cook at quantum-sci.com
> <mailto:c.a.cook at quantum-sci.com>> wrote:
>
>
>     On 2020-09-09 07:31, Ralph Little wrote:
>     > Hi,
>
>  
>
>     I did as Olaf suggested and "Name or service not known", which doesn't
>     make sense:
>
>     # SANE_DEBUG_NET=128 scanimage -L
>     [sanei_debug] Setting debug level of net to 128.
>     [net] sane_init: authorize != null, version_code != null
>     [net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6) from
>     sane-backends 1.0.27
>     [net] sane_init: Client has little endian byte order
>     [net] sane_init: searching for config file
>     [net] sane_init: connect timeout set to 30 seconds
>     [net] sane_init: trying to add scan-server
>     [net] add_device: adding backend scan-server
>     [net] add_device: error while getting address of host scan-server:
>     Name
>     or service not known
>     [net] sane_init: trying to add localhost
>     [net] add_device: adding backend localhost
>     [net] add_device: backend localhost added
>     [net] sane_init: done reading config
>     [net] sane_init: evaluating environment variable SANE_NET_HOSTS
>     [net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
>     [net] sane_init: done
>     [net] sane_get_devices: local_only = 0
>     [net] connect_dev: trying to connect to localhost
>     [net] connect_dev: [0] connection succeeded (IPv4)
>     [net] connect_dev: sanei_w_init
>     [net] connect_dev: net_init (user=carl, local version=1.0.3)
>     [net] connect_dev: freeing init reply (status=Success, remote
>     version=1.0.3)
>     [net] connect_dev: done
>     [net] sane_get_devices: finished (0 devices)
>
>  
> So it looks from the trace that it is trying to (unsuccessfully)
> resolve the scan-server host.
> I would simplify this for the moment to just include the IP address of
> scan-server in net.conf and try again.
>
> I tried something similar here to see what we would expect:
>
> [09:32:15.216089] [net] sane_init: searching for config file
> [09:32:15.216101] [net] sane_init: trying to add scan-server
> [09:32:15.216108] [net] add_device: adding backend scan-server
> [09:32:15.218803] [net] add_device: error while getting address of
> host scan-server: Temporary failure in name resolution
> [09:32:15.218827] [net] sane_init: trying to add 10.1.40.6
> [09:32:15.218836] [net] add_device: adding backend 10.1.40.6
> [09:32:15.219301] [net] add_device: backend 10.1.40.6 added
> [09:32:15.219313] [net] sane_init: done reading config
>
> In my net.conf I have:
>
> #
> # Comments...
> #
> scan-server
> 10.1.40.6
>
> You can see that even though scan-server cannot be found, it still
> adds the 10.1.40.6 host entry.
>
> Alternatively, you can just specify the IP address in SANE_NET_HOSTS
> env variable:
>
> SANE_NET_HOSTS=10.1.60.4 SANE_DEBUG_NET=128 scanimage -L
>
> .. and that IP address will be included in addition to what is in
> net.conf.
>
> Let us know what output you get. Hopefully that will give us something
> to go on.
>
> Cheers,
> Ralph

Changed my net.conf to:

scan-server
127.0.0.1

Remember I'm using a reverse SSH tunnel to bring 6566 to the client
machine.  I've used this method for years and know it works.  selinux is
off on client and server, and the firewall isn't involved on localhost.
(CentOS 7.6)

Here's the traffic when I do the scanimage command:

# tcpdump 'tcp port 6566' -i lo
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes
10:19:50.050969 IP localhost.38946 > localhost.sane-port: Flags [S], seq
1236909838, win 43690, options [mss 65495,nop,wscale 7], length 0
10:19:50.051014 IP localhost.sane-port > localhost.38946: Flags [S.],
seq 626504402, ack 1236909839, win 43690, options [mss 65495,nop,wscale
7], length 0
10:19:50.051039 IP localhost.38946 > localhost.sane-port: Flags [.], ack
1, win 342, length 0
10:19:50.051407 IP localhost.38946 > localhost.sane-port: Flags [P.],
seq 1:18, ack 1, win 342, length 17
10:19:50.051440 IP localhost.sane-port > localhost.38946: Flags [.], ack
18, win 342, length 0
10:19:50.063776 IP localhost.sane-port > localhost.38946: Flags [P.],
seq 1:9, ack 18, win 342, length 8
10:19:50.063794 IP localhost.38946 > localhost.sane-port: Flags [.], ack
9, win 342, length 0
10:19:50.063868 IP localhost.38946 > localhost.sane-port: Flags [P.],
seq 18:22, ack 9, win 342, length 4
10:19:50.070087 IP localhost.sane-port > localhost.38946: Flags [P.],
seq 9:21, ack 22, win 342, length 12
10:19:50.070248 IP localhost.38946 > localhost.sane-port: Flags [P.],
seq 22:26, ack 21, win 342, length 4
10:19:50.070287 IP localhost.38946 > localhost.sane-port: Flags [F.],
seq 26, ack 21, win 342, length 0
10:19:50.073319 IP localhost.sane-port > localhost.38946: Flags [F.],
seq 21, ack 27, win 342, length 0
10:19:50.073346 IP localhost.38946 > localhost.sane-port: Flags [.], ack
22, win 342, length 0

I didn't see any traffic when not specifying the interface, so
apparently in that case lo is ignored.  But now I see attempts.

I changed net.conf to 127.0.0.1 instead of localhost and:

# SANE_DEBUG_NET=128 scanimage -L
[sanei_debug] Setting debug level of net to 128.
[net] sane_init: authorize != null, version_code != null
[net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6) from
sane-backends 1.0.27
[net] sane_init: Client has little endian byte order
[net] sane_init: searching for config file
[net] sane_init: connect timeout set to 30 seconds
[net] sane_init: trying to add scan-server
[net] add_device: adding backend scan-server
[net] add_device: error while getting address of host scan-server: Name
or service not known
[net] sane_init: trying to add 127.0.0.1
[net] add_device: adding backend 127.0.0.1
[net] add_device: backend 127.0.0.1 added
[net] sane_init: done reading config
[net] sane_init: evaluating environment variable SANE_NET_HOSTS
[net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
[net] sane_init: done
[net] sane_get_devices: local_only = 0
[net] connect_dev: trying to connect to 127.0.0.1
[net] connect_dev: [0] connection succeeded (IPv4)
[net] connect_dev: sanei_w_init
[net] connect_dev: net_init (user=carl, local version=1.0.3)
[net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
[net] connect_dev: done
[net] sane_get_devices: finished (0 devices)

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
[net] sane_exit: exiting
[net] sane_exit: closing dev 0x55f2484331e0, ctl=3
[net] sane_exit: finished.


# SANE_NET_HOSTS=127.0.0.1 SANE_DEBUG_NET=128 scanimage -L
[sanei_debug] Setting debug level of net to 128.
[net] sane_init: authorize != null, version_code != null
[net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6) from
sane-backends 1.0.27
[net] sane_init: Client has little endian byte order
[net] sane_init: searching for config file
[net] sane_init: connect timeout set to 30 seconds
[net] sane_init: trying to add scan-server
[net] add_device: adding backend scan-server
[net] add_device: error while getting address of host scan-server: Name
or service not known
[net] sane_init: trying to add 127.0.0.1
[net] add_device: adding backend 127.0.0.1
[net] add_device: backend 127.0.0.1 added
[net] sane_init: done reading config
[net] sane_init: evaluating environment variable SANE_NET_HOSTS
[net] sane_init: trying to add 127.0.0.1
[net] add_device: adding backend 127.0.0.1
[net] add_device: already in list
[net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
[net] sane_init: done
[net] sane_get_devices: local_only = 0
[net] connect_dev: trying to connect to 127.0.0.1
[net] connect_dev: [0] connection succeeded (IPv4)
[net] connect_dev: sanei_w_init
[net] connect_dev: net_init (user=carl, local version=1.0.3)
[net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
[net] connect_dev: done
[net] sane_get_devices: finished (0 devices)

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
[net] sane_exit: exiting
[net] sane_exit: closing dev 0x55a24edeb1e0, ctl=3

[net] sane_exit: finished


# tcpdump 'tcp port 6566' -i lo

10:24:05.641919 IP localhost.38972 > localhost.sane-port: Flags [S], seq
677410379, win 43690, options [mss 65495,nop,wscale 7], length 0
10:24:05.641970 IP localhost.sane-port > localhost.38972: Flags [S.],
seq 1312293621, ack 677410380, win 43690, options [mss 65495,nop,wscale
7], length 0
10:24:05.641997 IP localhost.38972 > localhost.sane-port: Flags [.], ack
1, win 342, length 0
10:24:05.642549 IP localhost.38972 > localhost.sane-port: Flags [P.],
seq 1:18, ack 1, win 342, length 17
10:24:05.642571 IP localhost.sane-port > localhost.38972: Flags [.], ack
18, win 342, length 0
10:24:05.660806 IP localhost.sane-port > localhost.38972: Flags [P.],
seq 1:9, ack 18, win 342, length 8
10:24:05.660838 IP localhost.38972 > localhost.sane-port: Flags [.], ack
9, win 342, length 0
10:24:05.660988 IP localhost.38972 > localhost.sane-port: Flags [P.],
seq 18:22, ack 9, win 342, length 4
10:24:05.667069 IP localhost.sane-port > localhost.38972: Flags [P.],
seq 9:21, ack 22, win 342, length 12
10:24:05.667238 IP localhost.38972 > localhost.sane-port: Flags [P.],
seq 22:26, ack 21, win 342, length 4
10:24:05.667278 IP localhost.38972 > localhost.sane-port: Flags [F.],
seq 26, ack 21, win 342, length 0
10:24:05.671261 IP localhost.sane-port > localhost.38972: Flags [F.],
seq 21, ack 27, win 342, length 0
10:24:05.671287 IP localhost.38972 > localhost.sane-port: Flags [.], ack
22, win 342, length 0




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20200909/1d0d1e3c/attachment.html>


More information about the sane-devel mailing list