Hi Lennart,<br>It is not that ugly shortcut ;-), but yeah this is a hack.(BTW Bonjour is doing it in similar way. Nothing goes on the network for local services. Everything is in memory. I don&#39;t know their reasons, but I sure do know mine.)<br>


<br>Reading through&nbsp; your&nbsp; plan for&nbsp; this&nbsp; I recall removing the code for filtering the interfaces.<br>And I also recall having problems using the loopback interface to do the multicast.<br>It might be just me, but I couldn&#39;t get this working and I&#39;ve seen comments that the kernel doesn&#39;t route multicast messages on the loopback interface.<br>


Frankly I haven&#39;t confirmed this myself, but definitely couldn&#39;t get it to work.<br><br>Another thought just came to my mind. The loopback interface is actually addressable with index 1. <br>I&#39;m not sure whether this is is always the case, but at least on my testing index 1 was always the loopback.<br>


<br>So if the loopback can be used (and I&#39;m wrong about the kernel) and the loopback is always addressable with index 1 then the avahi-core can use it if nothing else is available or if explicitly requested. This shouldn&#39;t be hard to code, right?<br>


<br>--Yavor<br><br><br><div class="gmail_quote">On Feb 13, 2008 2:57 AM, Lennart Poettering &lt;<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div>On Tue, 12.02.08 12:07, Yavor Goulishev (<a href="mailto:ygoulishev@gmail.com" target="_blank">ygoulishev@gmail.com</a>) wrote:<br><br>&gt; &nbsp;Great!<br>&gt; I really need this feature.<br>&gt; BTW I tried implementing something, but I&#39;m not that much familiar with the<br>


&gt; avahi internals.<br>&gt; I&#39;m attaching my patch. Basically I was able to transfer registered local<br>&gt; services into the cache without receiving a messages on the network.<br>&gt; Of course that is just one step. The cache needs to be kept up to date.<br>


&gt; I used the following call to test:<br>&gt; &nbsp; &nbsp; avahi_server_add_service(server, group, 1, AVAHI_PROTO_UNSPEC,<br>&gt; AVAHI_PUBLISH_NO_ANNOUNCE, &quot;My Service Name&quot;, &quot;_daap._tcp&quot;, NULL, NULL,<br>&gt; 7777, &quot;foo&quot;, NULL);<br>


&gt;<br>&gt; I used avahi-0.6.21 source.<br><br></div>Uh. This doesn&#39;t look right to me. I think the better way to handle<br>this is to change the way Avahi currently deals with interfaces. Right<br>now, Avahi ignores all interfaces that are POINTOPOINT, LOOPBACK or<br>


lack MULTICAST. I think it would be better to not ignore LOOPBACK<br>unconditionally. Instead we should deal with it like any other<br>interface, howver with the special excpetion, that AVAHI_IF_UNSPEC<br>does not match it, unless there it is the only interface available.<br>


<br>I would suggest a solution like this: We add a new definition<br>AVAHI_IF_LOOPBACK = -2. Then, if a RR is registered, and a positive<br>ifindex is passed, we just do our work as usual on the specified<br>interface. If -1 is passed as ifindex (i.e. AVAHI_IF_UNSPEC), we use<br>


the loopback interface if no real interfaces are known, or the real<br>interfaces if they are available but in that case we don&#39;t use the<br>loopback to avoid duplicate instanes. If -2 is passed this is treated<br>like a positive ifindex for the loopack device.<br>


<br>The difficulty of course comes when we have to move a service between<br>the loopback device and a real device everytime the network is<br>configured/unconfigured.<br><br>This scheme would not only fix your problem but also #92. Also, it<br>


doesn&#39;t require any ugly shortcuts etween the zone and the cache.<br><br>Patches welcome! Unless they introduce those 36h days I don&#39;t think I<br>will have the time to implement something like this anytime soon.<br>


<div><div></div><div><br>Lennart<br><br>--<br>Lennart Poettering &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Red Hat, Inc.<br>lennart [at] poettering [dot] net &nbsp; &nbsp; &nbsp; &nbsp; ICQ# 11060553<br><a href="http://0pointer.net/lennart/" target="_blank">http://0pointer.net/lennart/</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GnuPG 0x1A015CC4<br>


_______________________________________________<br>avahi mailing list<br><a href="mailto:avahi@lists.freedesktop.org" target="_blank">avahi@lists.freedesktop.org</a><br><a href="http://lists.freedesktop.org/mailman/listinfo/avahi" target="_blank">http://lists.freedesktop.org/mailman/listinfo/avahi</a><br>


</div></div></blockquote></div><br>