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: signature.asc
Description: This is a digitally signed message part.

Reply via email to