All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: Marek Lindner <marek.lindner@mailbox.org>,
	Simon Wunderlich <sw@simonwunderlich.de>,
	Antonio Quartulli <antonio@mandelbit.com>,
	Matthias Schiffer <mschiffer@universe-factory.net>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Matthias Schiffer <mschiffer@universe-factory.net>
Subject: Re: [PATCH batadv 2/5] batman-adv: only create hardif while a netdev is part of a mesh
Date: Sat, 31 May 2025 11:52:12 +0200	[thread overview]
Message-ID: <6005840.1IzOArtZ34@sven-desktop> (raw)
In-Reply-To: <e311c7d643fa1a7d13f2b518f6ee525eb6711f6c.1747687504.git.mschiffer@universe-factory.net>

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

On Monday, 19 May 2025 22:46:29 CEST Matthias Schiffer wrote:
> -int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
> +int batadv_hardif_enable_interface(struct net_device *net_dev,
>                                    struct net_device *mesh_iface)
>  {
[....]
> +       hard_iface->wifi_flags = batadv_wifi_flags_evaluate(net_dev);

Moving this here should break the WIFI TT flag in scenarios like this:

                   ┌──────┐             
       ┌───────────┼br-lan├──────┐      
       │           └──────┘      │      
       │                         │      
       │                         │      
     ┌─▼─┐                    ┌──▼─┐    
     │ap0│                    │bat0│    
     └───┘                    └──┬─┘    
                                 │      
                                 │      
                              ┌──▼──┐   
                              │mesh0│   
                              └─────┘   


ap0 is not the lower interface of any batadv mesh interface but TT ap 
isolation is depending on the information stored for this hardif. See:



/**
 * batadv_is_wifi_hardif() - check if the given hardif is a wifi interface
 * @hard_iface: the device to check
 *
 * Return: true if the net device is a 802.11 wireless device, false otherwise.
 */
bool batadv_is_wifi_hardif(struct batadv_hard_iface *hard_iface)
{
	if (!hard_iface)
		return false;

	return hard_iface->wifi_flags != 0;
}

bool batadv_tt_local_add(struct net_device *mesh_iface, const u8 *addr,
			 unsigned short vid, int ifindex, u32 mark)
{
[...]
	if (ifindex != BATADV_NULL_IFINDEX)
		in_dev = dev_get_by_index(net, ifindex);

	if (in_dev)
		in_hardif = batadv_hardif_get_by_netdev(in_dev);
[...]
	if (batadv_is_wifi_hardif(in_hardif))
		tt_local->common.flags |= BATADV_TT_CLIENT_WIFI;
[...]


static bool
_batadv_is_ap_isolated(struct batadv_tt_local_entry *tt_local_entry,
		       struct batadv_tt_global_entry *tt_global_entry)
{
	if (tt_local_entry->common.flags & BATADV_TT_CLIENT_WIFI &&
	    tt_global_entry->common.flags & BATADV_TT_CLIENT_WIFI)
		return true;

	/* check if the two clients are marked as isolated */
	if (tt_local_entry->common.flags & BATADV_TT_CLIENT_ISOLA &&
	    tt_global_entry->common.flags & BATADV_TT_CLIENT_ISOLA)
		return true;

	return false;
}


Kind regards,
	Sven

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

  parent reply	other threads:[~2025-05-31  9:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19 20:46 [PATCH batadv 1/5] batman-adv: store hard_iface as iflink private data Matthias Schiffer
2025-05-19 20:46 ` [PATCH batadv 2/5] batman-adv: only create hardif while a netdev is part of a mesh Matthias Schiffer
2025-05-31  9:16   ` Sven Eckelmann
2025-05-31  9:21     ` Sven Eckelmann
2025-05-31  9:52   ` Sven Eckelmann [this message]
2026-05-10 13:59     ` Sven Eckelmann
2025-05-19 20:46 ` [PATCH batadv 3/5] batman-adv: remove BATADV_IF_NOT_IN_USE hardif state Matthias Schiffer
2025-05-31  9:18   ` Sven Eckelmann
2025-05-19 20:46 ` [PATCH batadv 4/5] batman-adv: remove global hardif list Matthias Schiffer
2025-05-31  9:56   ` Sven Eckelmann
2025-06-01  9:26     ` Matthias Schiffer
2025-06-01 13:10       ` Sven Eckelmann
2025-06-01 13:36         ` Sven Eckelmann
2026-05-10  7:30   ` Sven Eckelmann
2025-05-19 20:46 ` [PATCH batadv 5/5] batman-adv: move hardif generation counter into batadv_priv Matthias Schiffer
2025-05-31  9:59   ` Sven Eckelmann
2025-05-31  8:31 ` [PATCH batadv 1/5] batman-adv: store hard_iface as iflink private data 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=6005840.1IzOArtZ34@sven-desktop \
    --to=sven@narfation.org \
    --cc=antonio@mandelbit.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.lindner@mailbox.org \
    --cc=mschiffer@universe-factory.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sw@simonwunderlich.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.