Re: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: convert batman iv algorithm to use dynamic infrastructure

Simon Wunderlich
2011-12-06T19:20:01Z

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

On Mon, Dec 05, 2011 at 04:00:48AM +0800, Marek Lindner wrote:
> > > + void (*bat_ogm_init)(struct hard_iface *hard_iface);
> > > + void (*bat_ogm_init_primary)(struct hard_iface *hard_iface);
> > > + void (*bat_ogm_update_mac)(struct hard_iface *hard_iface);
> > > + void (*bat_ogm_schedule)(struct hard_iface *hard_iface,
> > > + int tt_num_changes);
> >
> > can't we put tt_num_changes somewhere bat_priv?
>
> tt_num_changes holds the number of changed TT entries since the last OGM.
> Obviously that changes all the time. Are you suggesting we store this value in
> bat_priv instead of a local variable ?
>
Yup. I know that it is changed all the time, just as tt_buff and tt_len changes
- it is updated when the packet is generated.

There is not really a technical advantage (or disadvantage), it would just be
more clean if information like this is stored in bat_priv IMHO - we fetch other
stuff like the tt buffer or the ogm from structs like bat_priv or hard interfaces.
And maybe we want to change something in this mechanism in the future.

Just my personal opinion ;)
Simon

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]