auto-discover of network printers relies on ip6?

Helge Blischke h.blischke at acm.org
Mon Apr 23 00:22:16 PDT 2012


willie wrote:

>> willie wrote:
>>
>> >> willie wrote:
>> >>
>> >> >
>> >> > willie wrote:
>> >> >>
>> >> >> >
>> >> >> > Hi,
>> >> >> >
>> >> >> > Sorry for the delay.
>> >> >> >
>> >> >> > There's a lot of this - /var/log/cups/error_log with debugging
>> >> >> > turned on
>> >> >
>> >> >
>> >> >     < snipped big log file >
>> >> >
>> >> >
>> >> > Helge wrote:
>> >> >>
>> >> >> The 1.5.2 SNMP backend, if compiled with IPV6 support, exits with
>> >> >> return code 1 if IPV6 is disabled as you did. Thus, under these
>> >> >> circumstances, no printers are autodiscovered by SNMP.
>> >> >>
>> >> >
>> >> >
>> >> > Many thanks for this Helge.
>> >> >
>> >> > I saw the "snmp stopped with status 1" message but didn't associate
>> >> > it with missing ipv6 kernel support - especially after Michael's
>> >> > earlier comment about life continuing within cupsd without ipv6.
>> >> >
>> >> > I'm not trying to do anything exotic here and I'll be very surprised
>> >> > if no one else out there is using cups without an ip6 stack, but
>> >> > your reply above "...under these circumstances..." suggests the
>> >> > title of this thread is in fact correct. If so, what are my options
>> >> > - try to compile my own cups software without ipv6 support? Will
>> >> > that allow a machine to discover network printers with just ipv4?
>> >> >
>> >> > Thanks again.
>> >>
>> >> Yes, I'd download the sources (of just the cups version you are using)
>> >> and building without IPV6 support, but do not install is as usual,
>> >> only replace the current snmp backend with the compiled one.
>> >> Do not hesitate to aks again whenever you need help.
>> >>
>> >> Helge
>> >
>> >
>> >
>> > Cheers Helge.
>> >
>> > I've fallen at the first fence.
>> >
>> > I've looked through the documents and compile notes in the source
>> > package and can find no configure prefix or any other obvious way of
>> > disabling ip6 - anywhere, let alone just the snmp backend. In fact the
>> > only occurrences of "ipv6" or "ip6" in the entire tarball are in a few
>> > of the source files, eg. "backend/snmp.c", but I was hoping for
>> > something that requires less than my pitiful programming skills, and
>> > doubt anyone should be altering the source code in any case...
>> >
>> > Have I missed something?
>>
>> Well, you need to do some tweaking, as the SNMP backend checks for ipv6
>> if the kernel supports IPv6 by design, wether it is disabled by
>> configuration means or not.
>> So you should do - after running configure :
>> - edit backend/snmp.c as follows:
>>   replace the lines starting with
>>   #ifdef AF_INET6
>>   up to and including the line
>>   #endif /* AF_INET6 */
>>   (these are lines 252 to 257 in my copy)
>>   by the single line
>>   ipv6 = -1;
>> - then run make
>> - replace your current snmp backend by the modified one.
> 
> 
> 
> Helge,
> 
> Thanks for that. It worked perfectly.
> 
> Is it necessary to make the above edit *after* running ./configure? I ask
> this because, if so, I'm having difficulty finding a way to modify the
> (archlinux) abs PKGBUILD script to automate the process and pick up the
> arch patches.
> 
> There's still a possibility that my Brother HL5250 is the problem here,
> but if not, I'd respectfully describe this as a bug. The web is ridden
> with advice on how to disable kernel ip6 stacks to reduce memory usage and
> more importantly to speed up many software packages. Now it appears that
> doing this cripples one aspect of cups, which surely sits high on the list
> of important open source desktop packages.
> 
> When ipv6 is still far from widespread, would it be much of a task to put
> a configuration hook into the build to select for ip4/ip6/both?
> 
> Thanks again for your time, which has improved my meagre understanding of
> this stuff.
> 
> Willie

Willie,

I've looked into the stuff once more, and yes, you may do the edit before 
the configure run, i.e. at the very beginning. There is nothing in the 
configure script that touches the AF_INET6; this is simply defined in 
/usr/include/sys/socket.h if the system supports IPv6 by design.

And yes, I'd recommend to file a bug on this issue - the arguments you 
mentioned seem convincing to me.

Helge





More information about the cups mailing list