public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Gus Wirth <gwirth79@gmail.com>
To: b.a.t.m.a.n@lists.open-mesh.net
Subject: Re: [B.A.T.M.A.N.] [PATCH] Updating orig_str for debug
Date: Wed, 02 Dec 2009 18:46:41 -0800	[thread overview]
Message-ID: <4B172691.8010707@gmail.com> (raw)
In-Reply-To: <20091203002407.GA10048@Linus-Debian>

On 12/02/2009 04:24 PM, Linus Lüssing wrote:
> In commit 1488 the orig_str has been removed from
> purge_orig_neighbours(). Apparently, this breaks compilation when
> enabling debug-flags, as bat_dbg() is expecting this variable as a
> parameter. Actually, this variable has never been initialised also
> before commit 1488 (which was probably the reason for mistakenly
> removing it).
> This tiny patch adds the orig_str again, but initialises it now as
> well.
>
> Signed-off-by: Linus Lüssing<linus.luessing@web.de>
> ---
>
> Index: originator.c
> ===================================================================
> --- originator.c        (revision 1489)
> +++ originator.c        (working copy)
> @@ -163,7 +163,7 @@
>                                   struct neigh_node **best_neigh_node)
>   {
>          struct list_head *list_pos, *list_pos_tmp;
> -       char neigh_str[ETH_STR_LEN];
> +       char neigh_str[ETH_STR_LEN], orig_str[ETH_STR_LEN];
>          struct neigh_node *neigh_node;
>          bool neigh_purged = false;
>
> @@ -179,6 +179,7 @@
>                                  ((PURGE_TIMEOUT * HZ) / 1000)))) {
>
>                          addr_to_string(neigh_str, neigh_node->addr);
> +                       addr_to_string(orig_str, orig_node->orig);
>                          bat_dbg(DBG_BATMAN, "Neighbour timeout: originator %s, neighbour: %s, last_valid %lu\n", orig_str, neigh_str, (neigh_node->last_valid / HZ));
>
>                          neigh_purged = true;
>

=================

Shouldn't the "addr_to_string(orig_str, orig_node->orig);" be moved out 
side the loop to near the top of the function? There is only one 
originator node and there is no reason to iterate over it. One time 
should suffice.

Gus

  parent reply	other threads:[~2009-12-03  2:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03  0:24 [B.A.T.M.A.N.] [PATCH] Updating orig_str for debug Linus Lüssing
2009-12-03  2:45 ` Marek Lindner
2009-12-03  2:46 ` Gus Wirth [this message]
2009-12-03  2:48   ` Marek Lindner
2009-12-03  5:53     ` Andrew Lunn

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=4B172691.8010707@gmail.com \
    --to=gwirth79@gmail.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.net \
    /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