Patch written for "Presence not updated, when client disconencts from telepathy-salut"

Ajay Garg ajay at activitycentral.com
Mon Jul 9 08:33:17 EDT 2012


Hi all.

I have written a patch for "Avahi", that solves the bugs

[UPSTREAM]         http://bugs.sugarlabs.org/ticket/3748
[DOWNSTREAM]   http://dev.laptop.org.au/issues/1332



###########################################################################################################


For brevity, I am specifying the use-case ::

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.


The expected behaviour is that XO-1 should also disappear from XO-2's
neighborhood-view after some time.


###########################################################################################################


The upstream bug id is ::

https://bugs.freedesktop.org/process_bug.cgi


###########################################################################################################


The patch is located at ::

http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/common-patch-for-f14-and-f17/customize-avahi-default-ttl-values.patch




For brevity, I am pasting the patch description


Please refer https://bugs.freedesktop.org/show_bug.cgi?id=51501

History ::
===========

As pointed out by Simon McVittie in
https://bugs.freedesktop.org/show_bug.cgi?id=51501#c4,
https://tools.ietf.org/html/draft-cheshire-dnsext-multicastdns-15#section-10
suggests that the Time-To-Live (TT) of the mDNS record is likely to be
120 seconds.

However, for all purposes, in whatever testing I came across Avahi,
the TTL in effect was
75 minutes , which seemed a bit too late a notification of
buddy-going-disconnected.



Fix ::
======
Decrease the Time-To-Live (TTL).



Solution ::
===========

Obviously, the easiest solution is to set the appropriate values in
                  #define AVAHI_DEFAULT_TTL_HOST_NAME
		  #define AVAHI_DEFAULT_TTL

However, this has the following caveats ::

(i)
It needs a re-compilation/re-packaging of avahi rpms, for every
change in the values. This is a major deployment headache.

(ii)
Also, there is no ideal "TTL" values.

The lesses the TTL values, more frequent multicast DNS packets will be exchanged
between a pair of peers, thus leading to more traffic.

However, too large a TTL value, would mean that the peer gets too late
a notification
of the buddy going disconnected.

Thus, ideal values can only be found out by testing in real-field.
This requires easy configuration of the TTL values, without needing to
re-compile the rpms.



Solution-Implementation ::
==========================

The cutomized TTL values will be read during "avahi-daemon" startup.

1.
AVAHI_DEFAULT_TTL_HOST_NAME will be set to the value, contained in the
file "/etc/avahi/avahi-default-ttl-host-name.conf".

Default value is the same as before, i.e. 120 (seconds).


2.
AVAHI_DEFAULT_TTL will be set to the value, contained in the
file "/etc/avahi/avahi-default-ttl.conf".

Default value is the same as before, i.e. 4500 (seconds), which is equal to
75 minutes.



How to customize ::
===================

a)
"sudo service avahi-daemon stop"

b)
Change the values in the corresponding conf files.

c)
"sudo service avahi-daemon start"




AUTHOR: Ajay Garg <ajay at activitycentral.com>


Thanks to ::

    Will Thompson    <will.thompson at collabora.co.uk>
    Simon McVittie   <simon.mcvittie at collabora.co.uk>
    Xavier Claessens <xclaesse at gmail.com>


###########################################################################################################


The pre-compiled RPMS (patched), both for F14 and F17, are available at ::

http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/platforms/f14/RPMS/
http://people.sugarlabs.org/ajay/root/freedesktop_bug_51501/platforms/f17/RPMS/


###########################################################################################################


I have done the preliminary testings, and things seem to work as expected.
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".


###########################################################################################################



Kindly test and review the patch, as this solves a pretty important issue :)



Thanks and Regards,
Ajay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20120709/e605ff41/attachment.html>


More information about the Devel mailing list