Project

General

Profile

Actions

Bug #164

closed

Local translation table update on a bat0 MAC change

Added by Def D over 11 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
09/05/2012
Due date:
% Done:

0%

Estimated time:

Description

Using batman-adv 2012.3.0

When I change the MAC addresse of bat0, the local translation table is not well updated.

root@openwrt:/# batctl tl
Locally retrieved addresses (from bat0) announced via TT (TTVN: 184):
 * 26:aa:aa:aa:aa:aa [.P...]
 * xx:xx:xx:xx:xx:xx [.....]
 * xx:xx:xx:xx:xx:xx [.....]
root@openwrt:/# ifconfig bat0 hw ether 36:aa:aa:aa:aa:aa
root@openwrt:/# batctl tl
Locally retrieved addresses (from bat0) announced via TT (TTVN: 186):
 * 26:aa:aa:aa:aa:aa [.P...]
 * 36:aa:aa:aa:aa:aa [.....]
 * xx:xx:xx:xx:xx:xx [.....]
 * xx:xx:xx:xx:xx:xx [.....]

--> The addesse 26:aa:aa:aa:aa:aa is not deleted because tagged as NoPurge.
--> The addesse 36:aa:aa:aa:aa:aa is not tagged as NoPurge.

static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
{
    struct batadv_priv *bat_priv = netdev_priv(dev);
    struct sockaddr *addr = p;

    if (!is_valid_ether_addr(addr->sa_data))
        return -EADDRNOTAVAIL;

    /* only modify transtable if it has been initialized before */
    if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) {
        batadv_tt_local_remove(bat_priv, dev->dev_addr,
                       "mac address changed", false);
        batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX);
    }

    memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
    dev->addr_assign_type &= ~NET_ADDR_RANDOM;
    return 0;
}

I think the addesse 36:aa:aa:aa:aa:aa is not tagged as NoPurged because the function batadv_tt_local_add is called before the update of mac addresse memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);

I'm right ?

Thanks.


Files

Actions

Also available in: Atom PDF