Hi all.<br><br>I have written a patch for "Avahi", that solves the bugs<br><br>[UPSTREAM]         <a href="http://bugs.sugarlabs.org/ticket/3748">http://bugs.sugarlabs.org/ticket/3748</a>  <br>[DOWNSTREAM]   <a href="http://dev.laptop.org.au/issues/1332">http://dev.laptop.org.au/issues/1332</a><br>
<br><br><br>###########################################################################################################<br><br><br>For brevity, I am specifying the use-case ::<br><br><pre style="font-family:arial,helvetica,sans-serif">
a)
XO-1 connects to telepathy-salut.

b)
XO-2 connects to telepathy-salut. Both XO-1,and XO-2, are able to see each
other in the neighborhood-view.

c)
XO-1 disconnects. XO-2 is now no more seen in XO-1's neighborhhod-view, BUT
XO-1 IS CONTINUED TO BE SEEN IN XO-2'S NEIGHBORHOOD-VIEW.<br><br><br>The expected behaviour is that XO-1 should also disappear from XO-2's neighborhood-view after some time.<br><br><br>###########################################################################################################<br>
<br><br>The upstream bug id is :: <br><br><a href="https://bugs.freedesktop.org/process_bug.cgi">https://bugs.freedesktop.org/process_bug.cgi</a><br><br><br>###########################################################################################################<br>
<br><br>The patch is located at ::<br><br><a href="http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/common-patch-for-f14-and-f17/customize-avahi-default-ttl-values.patch">http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/common-patch-for-f14-and-f17/customize-avahi-default-ttl-values.patch</a><br>
<br><br><br><br>For brevity, I am pasting the patch description<br><br><br>Please refer <a href="https://bugs.freedesktop.org/show_bug.cgi?id=51501">https://bugs.freedesktop.org/show_bug.cgi?id=51501</a><br><br>History ::<br>
===========<br><br>As pointed out by Simon McVittie in <a href="https://bugs.freedesktop.org/show_bug.cgi?id=51501#c4">https://bugs.freedesktop.org/show_bug.cgi?id=51501#c4</a>,<br><a href="https://tools.ietf.org/html/draft-cheshire-dnsext-multicastdns-15#section-10">https://tools.ietf.org/html/draft-cheshire-dnsext-multicastdns-15#section-10</a> <br>
suggests that the Time-To-Live (TT) of the mDNS record is likely to be 120 seconds.<br><br>However, for all purposes, in whatever testing I came across Avahi, the TTL in effect was<br>75 minutes , which seemed a bit too late a notification of buddy-going-disconnected.<br>
<br><br><br>Fix ::<br>======<br>Decrease the Time-To-Live (TTL).<br><br><br><br>Solution ::<br>===========<br><br>Obviously, the easiest solution is to set the appropriate values in <br>                  #define AVAHI_DEFAULT_TTL_HOST_NAME<br>
                  #define AVAHI_DEFAULT_TTL<br><br>However, this has the following caveats ::<br><br>(i)<br>It needs a re-compilation/re-packaging of avahi rpms, for every<br>change in the values. This is a major deployment headache.<br>
<br>(ii)<br>Also, there is no ideal "TTL" values. <br><br>The lesses the TTL values, more frequent multicast DNS packets will be exchanged<br>between a pair of peers, thus leading to more traffic.<br><br>However, too large a TTL value, would mean that the peer gets too late a notification<br>
of the buddy going disconnected.<br><br>Thus, ideal values can only be found out by testing in real-field.<br>This requires easy configuration of the TTL values, without needing to <br>re-compile the rpms.<br><br><br><br>
Solution-Implementation ::<br>==========================<br><br>The cutomized TTL values will be read during "avahi-daemon" startup.<br><br>1.<br>AVAHI_DEFAULT_TTL_HOST_NAME will be set to the value, contained in the <br>
file "/etc/avahi/avahi-default-ttl-host-name.conf".<br><br>Default value is the same as before, i.e. 120 (seconds).<br><br><br>2.<br>AVAHI_DEFAULT_TTL will be set to the value, contained in the <br>file "/etc/avahi/avahi-default-ttl.conf".<br>
<br>Default value is the same as before, i.e. 4500 (seconds), which is equal to <br>75 minutes.<br><br><br><br>How to customize ::<br>===================<br><br>a)<br>"sudo service avahi-daemon stop"<br><br>b)<br>
Change the values in the corresponding conf files.<br><br>c)<br>"sudo service avahi-daemon start"<br><br><br><br><br>AUTHOR: Ajay Garg <<a href="mailto:ajay@activitycentral.com">ajay@activitycentral.com</a>><br>
<br><br>Thanks to ::<br><br>    Will Thompson    <<a href="mailto:will.thompson@collabora.co.uk">will.thompson@collabora.co.uk</a>><br>    Simon McVittie   <<a href="mailto:simon.mcvittie@collabora.co.uk">simon.mcvittie@collabora.co.uk</a>><br>
    Xavier Claessens <<a href="mailto:xclaesse@gmail.com">xclaesse@gmail.com</a>><br><br><br>###########################################################################################################<br><br><br>The pre-compiled RPMS (patched), both for F14 and F17, are available at ::<br>
<br><a href="http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/platforms/f14/RPMS/">http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/platforms/f14/RPMS/</a><br><a href="http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/platforms/f17/RPMS/">http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/platforms/f17/RPMS/</a><br>
<br><br>###########################################################################################################<br><br><br>I have done the preliminary testings, and things seem to work as expected.<br>In particular, now the XO-2 disapplears from XO-1's neighborhood view, after the number of seconds specified in the file "/etc/avahi/avahi-default-ttl.conf".<br>
<br><br>###########################################################################################################<br><br><br><br>Kindly test and review the patch, as this solves a pretty important issue :)<br><br><br><br>
Thanks and Regards,<br>Ajay<br><br><br><br><br><br><br>
<br></pre><br><br><br><br><br>