From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv2 7/9] batman-adv: adapt the neighbor purging routine to use the new API functions
Date: Tue, 13 Aug 2013 08:08:31 +0200 [thread overview]
Message-ID: <20130813060831.GA22149@pandem0nium> (raw)
In-Reply-To: <20130812212535.GM849@ritirata.org>
[-- Attachment #1: Type: text/plain, Size: 2433 bytes --]
On Mon, Aug 12, 2013 at 11:25:35PM +0200, Antonio Quartulli wrote:
> On Mon, Aug 12, 2013 at 07:51:02PM +0200, Antonio Quartulli wrote:
> > On Mon, Aug 12, 2013 at 04:31:29PM +0200, Simon Wunderlich wrote:
> > > On Sun, Aug 11, 2013 at 02:33:21PM +0200, Antonio Quartulli wrote:
> > > > From: Antonio Quartulli <antonio@open-mesh.com>
> > > >
> > > > Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
> > > > ---
> > > > originator.c | 9 ++++++---
> > > > 1 file changed, 6 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/originator.c b/originator.c
> > > > index b3f6910..3ee8806 100644
> > > > --- a/originator.c
> > > > +++ b/originator.c
> > > > @@ -380,6 +380,8 @@ batadv_purge_orig_neighbors(struct batadv_priv *bat_priv,
> > > > bool neigh_purged = false;
> > > > unsigned long last_seen;
> > > > struct batadv_hard_iface *if_incoming;
> > > > + struct batadv_algo_ops *bao = bat_priv->bat_algo_ops;
> > > > + uint32_t neigh_metric, best_metric;
> > > >
> > > > *best_neigh_node = NULL;
> > > >
> > > > @@ -414,10 +416,11 @@ batadv_purge_orig_neighbors(struct batadv_priv *bat_priv,
> > > > batadv_bonding_candidate_del(orig_node, neigh_node);
> > > > batadv_neigh_node_free_ref(neigh_node);
> > > > } else {
> > > > - if ((!*best_neigh_node) ||
> > > > - (neigh_node->bat_iv.tq_avg >
> > > > - (*best_neigh_node)->bat_iv.tq_avg))
> > > > + neigh_metric = bao->bat_metric_get(neigh_node);
> > > > + if (!*best_neigh_node || (neigh_metric > best_metric)) {
> > >
> > > Shouldn't you initialize best_metric at some point?
> >
> > Actually I did initialise it with UINT_MAX but I have the feeling I forgot to
> > "add" the change to the commit. However this is only saving us from a warning
> > (which means the initialisation is needed) but not from any other problem:
> > best_metric will always have a value when best_neigh_node will be not NULL.
> >
> > Anyhow, good catch :)
> > Thanks for raising the point.
> >
> > Do you think I should send the entire patchset again? Or can I just resend this
> > patch only? Marek?
>
> Sorry, I was wrong. The initialisation I was talking about is done in
> batadv_find_ifalter_router() (so I did not forgot to add it :-)).
>
> Here instead it is not useful at all.
I think we still need an initialisation here. Even my compiler complains. :)
Cheers,
Simon
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2013-08-13 6:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-11 12:33 [B.A.T.M.A.N.] [PATCHv2 0/9] Improving the routing protocol abstraction Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 1/9] batman-adv: make struct batadv_neigh_node algorithm agnostic Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 2/9] batman-adv: make struct batadv_orig_node " Antonio Quartulli
2013-08-12 14:28 ` Simon Wunderlich
2013-08-12 17:48 ` Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 3/9] batman-adv: add bat_orig_print function API Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 4/9] batman-adv: add bat_metric_get API function Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 5/9] batman-adv: add bat_metric_is_equiv_or_better " Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 6/9] batman-adv: adapt bonding to use the new API functions Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 7/9] batman-adv: adapt the neighbor purging routine " Antonio Quartulli
2013-08-12 14:31 ` Simon Wunderlich
2013-08-12 17:51 ` Antonio Quartulli
2013-08-12 21:25 ` Antonio Quartulli
2013-08-13 6:08 ` Simon Wunderlich [this message]
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 8/9] batman-adv: provide orig_node routing API Antonio Quartulli
2013-08-11 12:33 ` [B.A.T.M.A.N.] [PATCHv2 9/9] batman-adv: adapt the TT component to use the new API functions Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130813060831.GA22149@pandem0nium \
--to=simon.wunderlich@s2003.tu-chemnitz.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox