Project

General

Profile

Actions

Feature #5052

closed

Avahi Proxy Package: Add option to disable/control cache size.

Added by Pete Whitfill over 9 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Avahi
Target version:
-
Start date:
08/30/2015
Due date:
% Done:

0%

Estimated time:
Plus Target Version:

Description

Request: Set "cache-entries-max=0" in the avahi-daemon.conf file or be able to control it some way.

I have successfully set up a LAN-pfsense-openVPN-pfsense-LAN routed tunnel network with the avahi proxy (reflector) package installed on both machines to advertise mDNS across the two networks.

My biggest problem in setup was that once the default config was enabled on one of the networks, many OSX hosts on that lan started incrementing a suffix on their hostnames:

"machine" becomes "machine (2)" which then becomes "machine (3)"

Some searching online found one reference to setting "cache-entries-max=0" in the avahi-daemon.conf file and upon testing, it worked. Now hostnames are remaining stable. Only downside is that any GUI interaction with the avahi config page would overwrite the config.

I then edited /usr/local/pkg/avahi.inc to update the template that is used to populate the running avahi-daemon.conf and the configuration change persists GUI changes.

I would recommend adding this as on option to the GUI or to consider setting this cache as 0 as default. It causes all kinds of havoc on a network of Mavericks and Yosemite machines. I could see where in some networks someone might want to use the caching to reduce bandwidth usage but I couldn't get it to work properly in our network without disabling it.

Actions #1

Updated by Pete Whitfill over 9 years ago

whoops...meant to submit this to packages.

doing that now.

Actions #2

Updated by Pete Whitfill over 9 years ago

okay...never mind...looks like I did :)

Actions #3

Updated by Kill Bill over 9 years ago

I have about zero clue what "cache size" are you talking about. Almost all documented config options are exposed in this PR and beyond that, please run your avahi controlled from shell yourself. This is getting insane. Get the Lennartware fixed properly upstream, instead of asking to expose totally undocumented options in the GUI.

https://github.com/pfsense/pfsense-packages/pull/1030

Actions #4

Updated by Kill Bill over 9 years ago

And BTW, what you described has nothing to do with "cache size" and everything to do with broken IPv6 privacy extensions handling in Lennartware.

https://forum.pfsense.org/index.php?topic=98734.0

Actions #5

Updated by Pete Whitfill over 9 years ago

Hi There,

So to clarify things, I have IPv6 disabled on both avahi proxy systems and I am not talking about avahi changing names.

What I am talking about turns out to be a problem with OSX Yosemite and the discoveryd system which replaced mDNSresponder for a few version and then was removed and replaced by mDNSresponder by Apple in the latest Yosemite release. What was happening was that when avahi was caching entries and sending them back across the network, the Yosemite machines were seeing the name and thinking there was another machine with the same name on the network. They would then increment their hostname internally (you can find it under the sharing system preference on the machine.)

As for cache-entries-max being an undocumented config option in avahi-daemon.conf, here is the entry from a man page for ubuntu for example: http://manpages.ubuntu.com/manpages/precise/man5/avahi-daemon.conf.5.html :

allow-point-to-point= Takes a boolean value ("yes" or "no"). If set  to
"yes" avahi-daemon will make use of interfaces with the POINTOPOINT
flag set. This option defaults to "no" as it might make mDNS unreliable
due to usually large latencies with such links and opens a potential
security hole by allowing mDNS access from Internet connections. Use
with care and YMMV!
cache-entries-max=  Takes  an  unsigned  integer  specifying  how  many
resource records are cached per interface. Bigger values allow mDNS
work correctly in large LANs but also increase memory consumption.
clients-max=   Takes   an  unsigned  integer.  The  maximum  number  of
concurrent D-Bus clients allowed. If the maximum number is reached
further clients will be refused until at least one existing client
disconnects.

So beyond that, I was simply making a suggestion and trying to share how I got things working... You guys do what you want. I have no idea why this is insane and I apologize for bothering you.

Good day sir. I will shut up now.

Thanks for some great software though... I really like it and am excited to be using it.

Actions #6

Updated by Kill Bill over 9 years ago

Perhaps these places would help to actually get something fixed, as opposed to adding configuration options that just confuse users and fix nothing?

http://lists.freedesktop.org/archives/avahi/
http://www.apple.com/feedback/macosx.html

Avahi = yet another piece of hit-and-run software produced by Mr. Poettering. Of course, you are free to do a pull request and get someone to merge this. I'm just a user who did a mistake of touching this package.

Actions #7

Updated by Jim Thompson about 9 years ago

  • Category set to Avahi
  • Assignee set to Jim Thompson
  • Target version set to 2.3
  • Affected Architecture All added
  • Affected Architecture deleted ()

avahi should be deprecated (it's also GPL, and mDNSresponder is Apache licensed, and in ports)

Actions #8

Updated by Kill Bill about 9 years ago

Not exactly convinced that switching from Lennertware to BittenFruitWare is going to change anything for the better... :P

Actions #9

Updated by Jim Thompson almost 9 years ago

  • Target version changed from 2.3 to 2.4.0
Actions #10

Updated by Phillip Davis almost 8 years ago

This has a target version of 2.4.0 - is that really intended?

Actions #11

Updated by Jim Pingle almost 8 years ago

  • Target version deleted (2.4.0)
Actions #12

Updated by Roland Kletzing almost 7 years ago

could you please add an option to set cache-entries-max=0 (or other arbitrary avahi config options?) - see below, it fixes the problem with automatic host renaming.

otherwise we have no option and need to stop using avahi plugin on pfsense and use it on another system...

thank you!

https://www.packetmischief.ca/2012/09/20/airplay-vlans-and-an-open-source-solution/

egoff
Aug 12, 2014 at 12:16pm MDT

Well…maybe I’m jumping the gun, but it seems to be behaving now, after setting cache-entries-max=0 in /etc/avahi/avahi-daemon.conf. That kind of makes sense, since we don’t want it to cache anything, just reflect. I was able to trigger the problem by printing to a shared printer from a Mac with 2 network interfaces connected to 2 Avahi-enabled VLANs at the same time. Now with cache-entries-max=0 in place, I can no longer get the problem to happen. We’ll see if that did it. Thanks for the cache hint!!!

Actions #13

Updated by Jim Pingle over 6 years ago

  • Assignee changed from Jim Thompson to Jim Pingle
Actions #14

Updated by Jim Pingle over 6 years ago

  • Status changed from New to Feedback

Added to Avahi pkg v 1.12

Actions #15

Updated by Jim Pingle over 6 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF