public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
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.] switch routing algorithm at runtime
Date: Mon, 5 Dec 2011 15:25:53 +0100	[thread overview]
Message-ID: <20111205142553.GE10131@lunn.ch> (raw)
In-Reply-To: <201112052138.55069.lindner_marek@yahoo.de>

> The mesh is not going down when you bring down bat0. You can do whatever you 
> want with bat0 - the mesh continues to operate normally. Only when a hard-
> interface goes down the routing information relying on that very interface are 
> purged.

Ah, O.K. My understanding was wrong.
 
> Here comes the chicken & egg problem: We can't have bat0 and its routing 
> algorithm selection before we did not add at least one hard-interface.

Lets see if i have the call chain correct:

store_mesh_iface()->hardif_enable_interface()->softif_create()->mesh_init()

It is mesh_init() that really starts the mesh going, but there is no
real need to start it until the first hard interface is added.

So maybe we could spit this into two separate operations.

1) Create the software interface
2) Add a hard interface and start the mesh, if not already started.

So maybe two new sysfs files are needed:

/sys/class/net/batman_adv/add_mesh
/sys/class/net/batman_adv/rm_mesh

echo the name of a soft interface, bat0, into the add_mesh file and
the softif_create() function would be called for it, but not
mesh_init(). 

hardif_enable_interface() would see if the soft interface exists, as
it currently does, so keeping backwards compatibility. If it does not
exist, call softif_create. Then check if the soft interface has been
started. Maybe add another atomic to priv, started, which mesh_init()
can increment.

    Andrew

  parent reply	other threads:[~2011-12-05 14:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05  9:56 [B.A.T.M.A.N.] switch routing algorithm at runtime Marek Lindner
2011-12-05  9:56 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: add infrastructure to change " Marek Lindner
2011-12-05  9:56 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: convert batman iv algorithm to use dynamic infrastructure Marek Lindner
2011-12-05  9:56 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: allowing changing the routing algorithm via sysfs Marek Lindner
2011-12-05 11:27 ` [B.A.T.M.A.N.] switch routing algorithm at runtime Andrew Lunn
2011-12-05 11:35   ` Marek Lindner
2011-12-05 12:13     ` Andrew Lunn
2011-12-05 13:38       ` Marek Lindner
2011-12-05 14:09         ` Antonio Quartulli
2011-12-05 14:38           ` Andrew Lunn
2011-12-05 14:44             ` Antonio Quartulli
2011-12-05 14:25         ` Andrew Lunn [this message]
2011-12-06 15:01           ` Simon Wunderlich
2011-12-06 15:06             ` Antonio Quartulli
2011-12-06 15:21             ` Andrew Lunn
2011-12-06 15:30               ` Marek Lindner
2011-12-06 17:36                 ` Simon Wunderlich

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=20111205142553.GE10131@lunn.ch \
    --to=andrew@lunn.ch \
    --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