B.A.T.M.A.N Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: antonio@mandelbit.com
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [PATCH batadv 2/4] batman-adv: tt: only update flags for TT events
Date: Wed, 07 Oct 2026 12:46:31 +0200	[thread overview]
Message-ID: <2046633.tdWV9SEqCh@sven-desktop> (raw)
In-Reply-To: <20261007-tt-avoid-unhashed-event-v1-2-01c763657916@narfation.org>

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

On Wednesday, 7 October 2026 12:29:46 CEST Sven Eckelmann wrote:
> -               if (announce)
> -                       __batadv_tt_local_event(bat_priv, common,
> -                                               common->flags);
> +               /* BATADV_TT_CLIENT_ROAM can still be set (see above) when a
> +                * client which roamed away was re-added. It must not be
> +                * announced with an ADD because the other nodes would then
> +                * handle it as still roaming.
> +                */
> +               if (announce) {
> +                       event_flags = common->flags & ~BATADV_TT_CLIENT_ROAM;
> +                       __batadv_tt_local_event(bat_priv, common, event_flags);
> +               }

Antonio, this is rather awkward. It is caused by basically the return in 
following code:

		if (common->flags & BATADV_TT_CLIENT_PENDING) {
			batadv_dbg(BATADV_DBG_TT, bat_priv,
				   "Re-adding pending client %pM (vid: %d)\n",
				   common->addr, batadv_print_vid(common->vid));
			/* whatever the reason why the PENDING flag was set,
			 * this is a client which was enqueued to be removed in
			 * this orig_interval. Since it popped up again, the
			 * flag can be reset like it was never enqueued
			 */
			common->flags &= ~BATADV_TT_CLIENT_PENDING;

			return true;
		}

		if (common->flags & BATADV_TT_CLIENT_ROAM) {
			batadv_dbg(BATADV_DBG_TT, bat_priv,
				   "Roaming client %pM (vid: %d) came back to its original location\n",
				   common->addr, batadv_print_vid(common->vid));
			/* the ROAM flag is set because this client roamed away
			 * and the node got a roaming_advertisement message. Now
			 * that the client popped up again at its original
			 * location such flag can be unset
			 */
			common->flags &= ~BATADV_TT_CLIENT_ROAM;
			*roamed_back = true;
		}


I know, when you introduced the BATADV_TT_CLIENT_ROAM check in commit 
2443ba383c7d ("batman-adv: roaming handling mechanism redesign"), it was still 
a `goto add_orig_entry;`. But the behavior was the same: two packets are 
necessary to switch a BATADV_TT_CLIENT_PENDING|BATADV_TT_CLIENT_ROAM client 
back to having none of the two flags.

Why is this the case?

Regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-10-07 10:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 10:29 [PATCH batadv 0/4] batman-adv: tt: shashiko 20260930 follow ups Sven Eckelmann
2026-10-07 10:29 ` [PATCH batadv 1/4] batman-adv: tt: don't queue local events for unhashed entries Sven Eckelmann
2026-10-07 10:29 ` [PATCH batadv 2/4] batman-adv: tt: only update flags for TT events Sven Eckelmann
2026-10-07 10:46   ` Sven Eckelmann [this message]
     [not found]   ` <sashiko-outbox-162887@kernel.org>
2026-10-07 11:32     ` Sven Eckelmann
2026-10-07 10:29 ` [PATCH batadv 3/4] batman-adv: tt: avoid list_lock for unchanged local clients Sven Eckelmann
2026-10-07 10:29 ` [PATCH batadv 4/4] batman-adv: tt: drop ADD+DEL events of never announced clients Sven Eckelmann

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=2046633.tdWV9SEqCh@sven-desktop \
    --to=sven@narfation.org \
    --cc=antonio@mandelbit.com \
    --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