mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 10:49:28 +00:00
Here are some batman-adv bugfixes:
- Fix issues with adjusted MTUs (2 patches), by Sven Eckelmann - Fix header access for memory reallocation case, by Remi Pommarel - Fix two memory leaks (2 patches), by Remi Pommarel -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEE1ilQI7G+y+fdhnrfoSvjmEKSnqEFAmTc+eYWHHN3QHNpbW9u d3VuZGVybGljaC5kZQAKCRChK+OYQpKeobgFD/9oBvQKj9rObbnHIgxe3ZZ4x4po FOln4eLv83YZwVP54BC0X8COymO+gd3tBbGg9U1s9kpn+hIOXi7zI8xnmS/jrKGB t8tDQ/1S9laCfanfDoHDdQ96ifJfQR6Mp7ZH1e64L22Ag5hKjVoGeQp2Mf5X2S+S 7ZFdhofr/ZNi0Tz4Y+Jw9bh3W5TMnwSFfexSIfUJmh+06RGRRspOx2WbbgArMs12 hP4UST0cIfIr0CinBQz+LiyT90GgC6r+xjkQrP3LgzYegC7eBW+bQxLgCtnk+Hic +t+aS3SnityZzFyaNJrULX7/u8WJumW4udu0jDl9raAWIJBUV5pNr7sNagQ45mvE NZ4/VnWGg6MnjdPC6CIuU6AuCLZYn1NiE6mp1vuFxMpqmiJUhMjwjTp8DaLpQZCV vDYca/bBuDMbTIl5LxQ965svbNVDiAS6gNHbrVs2k3bq3Ji7QS1M7MVR3npehGT0 xInqQNO7QJ0c+/PaFMTZwi0LKk8qwvHLggsZyKXJ6i6YBH7YG1LTbEtqLT7rH3nv sHfTyPzw7b0oFh7/rSMzvf1P9yiMG1ZCY622uhU1M+CxA2Axr1Lcq1yc3umDP4Ds BM3JKilHsj/mM7g/HobBs7eg+BL9/KjNKFbj12Bc0xV7IXC4SNTlKSJUN0ZlGSsH RP7dNXOzS0LUErpARw== =EsR1 -----END PGP SIGNATURE----- Merge tag 'batadv-net-pullrequest-20230816' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== Here are some batman-adv bugfixes: - Fix issues with adjusted MTUs (2 patches), by Sven Eckelmann - Fix header access for memory reallocation case, by Remi Pommarel - Fix two memory leaks (2 patches), by Remi Pommarel * tag 'batadv-net-pullrequest-20230816' of git://git.open-mesh.org/linux-merge: batman-adv: Fix batadv_v_ogm_aggr_send memory leak batman-adv: Fix TT global entry leak when client roamed back batman-adv: Do not get eth header before batadv_check_management_packet batman-adv: Don't increase MTU when set by user batman-adv: Trigger events for auto adjusted MTU ==================== Link: https://lore.kernel.org/r/20230816163318.189996-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
7793a88e88
6 changed files with 29 additions and 5 deletions
|
@ -505,7 +505,7 @@ int batadv_v_elp_packet_recv(struct sk_buff *skb,
|
||||||
struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
|
struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
|
||||||
struct batadv_elp_packet *elp_packet;
|
struct batadv_elp_packet *elp_packet;
|
||||||
struct batadv_hard_iface *primary_if;
|
struct batadv_hard_iface *primary_if;
|
||||||
struct ethhdr *ethhdr = (struct ethhdr *)skb_mac_header(skb);
|
struct ethhdr *ethhdr;
|
||||||
bool res;
|
bool res;
|
||||||
int ret = NET_RX_DROP;
|
int ret = NET_RX_DROP;
|
||||||
|
|
||||||
|
@ -513,6 +513,7 @@ int batadv_v_elp_packet_recv(struct sk_buff *skb,
|
||||||
if (!res)
|
if (!res)
|
||||||
goto free_skb;
|
goto free_skb;
|
||||||
|
|
||||||
|
ethhdr = eth_hdr(skb);
|
||||||
if (batadv_is_my_mac(bat_priv, ethhdr->h_source))
|
if (batadv_is_my_mac(bat_priv, ethhdr->h_source))
|
||||||
goto free_skb;
|
goto free_skb;
|
||||||
|
|
||||||
|
|
|
@ -123,8 +123,10 @@ static void batadv_v_ogm_send_to_if(struct sk_buff *skb,
|
||||||
{
|
{
|
||||||
struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
|
struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
|
||||||
|
|
||||||
if (hard_iface->if_status != BATADV_IF_ACTIVE)
|
if (hard_iface->if_status != BATADV_IF_ACTIVE) {
|
||||||
|
kfree_skb(skb);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
batadv_inc_counter(bat_priv, BATADV_CNT_MGMT_TX);
|
batadv_inc_counter(bat_priv, BATADV_CNT_MGMT_TX);
|
||||||
batadv_add_counter(bat_priv, BATADV_CNT_MGMT_TX_BYTES,
|
batadv_add_counter(bat_priv, BATADV_CNT_MGMT_TX_BYTES,
|
||||||
|
@ -985,7 +987,7 @@ int batadv_v_ogm_packet_recv(struct sk_buff *skb,
|
||||||
{
|
{
|
||||||
struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
|
struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface);
|
||||||
struct batadv_ogm2_packet *ogm_packet;
|
struct batadv_ogm2_packet *ogm_packet;
|
||||||
struct ethhdr *ethhdr = eth_hdr(skb);
|
struct ethhdr *ethhdr;
|
||||||
int ogm_offset;
|
int ogm_offset;
|
||||||
u8 *packet_pos;
|
u8 *packet_pos;
|
||||||
int ret = NET_RX_DROP;
|
int ret = NET_RX_DROP;
|
||||||
|
@ -999,6 +1001,7 @@ int batadv_v_ogm_packet_recv(struct sk_buff *skb,
|
||||||
if (!batadv_check_management_packet(skb, if_incoming, BATADV_OGM2_HLEN))
|
if (!batadv_check_management_packet(skb, if_incoming, BATADV_OGM2_HLEN))
|
||||||
goto free_skb;
|
goto free_skb;
|
||||||
|
|
||||||
|
ethhdr = eth_hdr(skb);
|
||||||
if (batadv_is_my_mac(bat_priv, ethhdr->h_source))
|
if (batadv_is_my_mac(bat_priv, ethhdr->h_source))
|
||||||
goto free_skb;
|
goto free_skb;
|
||||||
|
|
||||||
|
|
|
@ -630,7 +630,19 @@ out:
|
||||||
*/
|
*/
|
||||||
void batadv_update_min_mtu(struct net_device *soft_iface)
|
void batadv_update_min_mtu(struct net_device *soft_iface)
|
||||||
{
|
{
|
||||||
soft_iface->mtu = batadv_hardif_min_mtu(soft_iface);
|
struct batadv_priv *bat_priv = netdev_priv(soft_iface);
|
||||||
|
int limit_mtu;
|
||||||
|
int mtu;
|
||||||
|
|
||||||
|
mtu = batadv_hardif_min_mtu(soft_iface);
|
||||||
|
|
||||||
|
if (bat_priv->mtu_set_by_user)
|
||||||
|
limit_mtu = bat_priv->mtu_set_by_user;
|
||||||
|
else
|
||||||
|
limit_mtu = ETH_DATA_LEN;
|
||||||
|
|
||||||
|
mtu = min(mtu, limit_mtu);
|
||||||
|
dev_set_mtu(soft_iface, mtu);
|
||||||
|
|
||||||
/* Check if the local translate table should be cleaned up to match a
|
/* Check if the local translate table should be cleaned up to match a
|
||||||
* new (and smaller) MTU.
|
* new (and smaller) MTU.
|
||||||
|
|
|
@ -153,11 +153,14 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
|
||||||
|
|
||||||
static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu)
|
static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu)
|
||||||
{
|
{
|
||||||
|
struct batadv_priv *bat_priv = netdev_priv(dev);
|
||||||
|
|
||||||
/* check ranges */
|
/* check ranges */
|
||||||
if (new_mtu < 68 || new_mtu > batadv_hardif_min_mtu(dev))
|
if (new_mtu < 68 || new_mtu > batadv_hardif_min_mtu(dev))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
dev->mtu = new_mtu;
|
dev->mtu = new_mtu;
|
||||||
|
bat_priv->mtu_set_by_user = new_mtu;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -774,7 +774,6 @@ check_roaming:
|
||||||
if (roamed_back) {
|
if (roamed_back) {
|
||||||
batadv_tt_global_free(bat_priv, tt_global,
|
batadv_tt_global_free(bat_priv, tt_global,
|
||||||
"Roaming canceled");
|
"Roaming canceled");
|
||||||
tt_global = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
/* The global entry has to be marked as ROAMING and
|
/* The global entry has to be marked as ROAMING and
|
||||||
* has to be kept for consistency purpose
|
* has to be kept for consistency purpose
|
||||||
|
|
|
@ -1546,6 +1546,12 @@ struct batadv_priv {
|
||||||
/** @soft_iface: net device which holds this struct as private data */
|
/** @soft_iface: net device which holds this struct as private data */
|
||||||
struct net_device *soft_iface;
|
struct net_device *soft_iface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @mtu_set_by_user: MTU was set once by user
|
||||||
|
* protected by rtnl_lock
|
||||||
|
*/
|
||||||
|
int mtu_set_by_user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @bat_counters: mesh internal traffic statistic counters (see
|
* @bat_counters: mesh internal traffic statistic counters (see
|
||||||
* batadv_counters)
|
* batadv_counters)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue