tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Problems with hplip package under NetBSD (current & 6.1)



I've been playing with the hplip package (pkgsrc-current) and found that
both the hp-setup and hp-probe commands fail when trying to scan the
network for printers. The problem appears to be related to setting up
multicast and although I have found a workaround I have copied tech-kern
for comments.

If you run 'hp-probe -b net' then the following error occurs:
HP Linux Imaging and Printing System (ver. 3.12.10a)
Printer Discovery Utility ver. 4.1

Copyright (c) 2001-14 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.


--------------------
| DEVICE DISCOVERY |
--------------------

Probing network for printers. Please wait, this will take approx. 10
seconds...

error: Unable to setup multicast socket for SLP: [Errno 22] Invalid argument
warning: No devices found on the 'net' bus. If this isn't the result you
are expecting,
warning: check your network connections and make sure your internet
warning: firewall software is disabled.

A bit of a poke around in the python scripts shows that the problem is
in file
/usr/pkg/share/hplip/base/slp.py where the code on line 72 appears:

 s.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_TTL, ttl)
 s.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_IF,
socket.inet_aton(intf) + socket.inet_aton('0.0.0.0'))
 s.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_LOOP ,1)

intf is set earlier to the ip address of the primary interface and it is
the IP_MULTICAST_IF operation which fails. If the code above is modified
to be:

s.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_TTL, ttl)
s.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_IF, socket.inet_aton(intf))
s.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_LOOP ,1)

then the multicast socket is set up correctly and the command works as
expected.

Not having much experience with multicast I am unsure what the extra
term with 0.0.0.0 is meant to acheive, but without it everything works.
There is another file which also has the same construct. I guess this
term doesn't cause problems with other OS's (or maybe no-one has tried
it), but it certainly needs a fix for NetBSD.

Some enlightenment would be useful before I file a PR...

Cheers,
Dave

============================================
Phone: 07805784357
Open Source O/S: www.netbsd.org
Caving: http://www.wirralcavinggroup.org.uk
============================================



Home | Main Index | Thread Index | Old Index