On Mon, Sep 02, 2013 at 12:49:03AM +0800, Marek Lindner wrote:
On Sunday, September 01, 2013 16:05:43 Antonio Quartulli wrote:
Upon reading this function a realized this "tt_diff_len = 0" mechanism is buggy. For instance, the changes_list list is not purged but keeps growing until it magically fits the ogm diff again. Or checking bat_priv->soft_iface-
mtu isn't terribly accurate either. The more I looked the more my head
started to spin. Suddenly, I was convinced we don't need the check anymore because we have the fragmentation but you are right - it won't help here. I'll add the check again but be aware that it is broken.
Right, there is a bug. We should purge the list in any case, even if tt_diff_len is 0.
Yes, checking tt_diff_len against bat_priv->soft_iface->mtu is probably not correct..shall we check it against the mtu of the primary interface? Anyway, this is outside the scope of this patch.
Checking the primary interface is not enough either. You would need to know how much space is left in the OGM itself (assuming nobody else is going to occupy it before you do). All registered tvlvs and their content have to be taken into account. As well as headers and other stuff ...
Looks like an interesting problem :) Moreover, assuming we prepare a "correct OGM" it may be the case that the mtu is changed later (after preparing but before sending it).
Cheers,