public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <ordex@autistici.org>
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.] batctl ping exit status
Date: Sat, 19 Nov 2011 12:04:41 +0100	[thread overview]
Message-ID: <20111119110441.GF30187@ritirata.org> (raw)
In-Reply-To: <CAFevQmPcoR3O5FHfHvuUkv4yrJMYd1MtsEMNZ24uwjXaUtXxeQ@mail.gmail.com>

On Sat, Nov 19, 2011 at 11:43:40 +0100, Filippo Sallemi wrote:
> Hi all,
> I'm working on a simple script that check if node is connected. The
> scope of this script is make every node able to autorescue in case of
> change channel on some gateway node.
> To do this check if i'm not a gateway try to ping my gateway ipaddress
> then if it not respond try to batctl ping my gateway mac and than if
> not respond for a number of tries the node try to find another
> channell with the same bssid.
> The problem is that batct ping every time exit with status 0 istead of
> behaviour of ping command that exit with 1 if ping fail. At this time
> I have to use some regex to check if batctl ping status command. It is
> possible to fix batctl ping to work such as ping command?

I think it is, we just need the proper patch :D
By the way, I see that the ping command returns SUCCESS even if only one
echo_reply is received. Therefore if you send 5 requests and get only 1 reply
(because the node somehow changed channel while you were pinging it), your
script will tell you that the node is UP anyway. Is this the wanted behaviour?

However a meaningful return value for batctl could be a good idea..(not for ping
only)

> 
> Rgds
> 
> -- 
> Filippo Sallemi

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

  reply	other threads:[~2011-11-19 11:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-19 10:43 [B.A.T.M.A.N.] batctl ping exit status Filippo Sallemi
2011-11-19 11:04 ` Antonio Quartulli [this message]
2011-11-19 13:17   ` Filippo Sallemi
2011-11-20 15:35 ` [B.A.T.M.A.N.] [PATCH] batctl: Return failure code when ping was not successful Sven Eckelmann
2011-11-22 10:59   ` Marek Lindner

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=20111119110441.GF30187@ritirata.org \
    --to=ordex@autistici.org \
    --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