On Sat, Jun 30, 2012 at 12:01:25PM +0200, Marek Lindner wrote:
On Wednesday, June 27, 2012 10:23:06 Antonio Quartulli wrote:
@@ -43,6 +43,10 @@ #define BATADV_PURGE_TIMEOUT 200000 /* 200 seconds */ #define BATADV_TT_LOCAL_TIMEOUT 3600000 /* in miliseconds */ #define BATADV_TT_CLIENT_ROAM_TIMEOUT 600000 /* in miliseconds */ +/* Used to compute the timeout value for the entries marked with TT_CLIENT_TEMP: + * temp_timeout_value = temp_timeout_fact * orig_int
- */
+#define BATADV_TT_CLIENT_TEMP_TIMEOUT_FACT 10UL
You implictely assume that all nodes have the originator interval which might not be the case. As soon as they are different this will horribly fail.
Why not using the originator sequence number instead ? It will give you a time independent timeout. You could say if we haven't received a TT ADD 3 sequence numbers after we added the temporary client is gets merged.
That is a very good idea. The problem is that in a much more general scenario we have to keep in mind that the client could roam before being announced. At that point, we will be waiting for an announcement coming from a wrong originator.
Actually we have the same problem with the ROAM flag. Right now we simply wait X seconds: if nobody claims this guy within such amount of time we purge it. We should probably do the same here...(we can reuse the same value we use for the roam flag).
Cheers,