Merge pull request #537 from ecsv/batadv-for-18.06

openwrt-18.06: batman-adv: Merge bugfixes from 2019.5
This commit is contained in:
Simon Wunderlich 2019-12-14 16:59:15 +01:00 committed by GitHub
commit b3125f0d4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 56 additions and 13 deletions

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv PKG_NAME:=batman-adv
PKG_VERSION:=2018.1 PKG_VERSION:=2018.1
PKG_RELEASE:=8 PKG_RELEASE:=9
PKG_HASH:=b866b28dbbe5c9238abbdf5abbc30fc526dea56898ce4c1bd76d5c017843048b PKG_HASH:=b866b28dbbe5c9238abbdf5abbc30fc526dea56898ce4c1bd76d5c017843048b
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz

View file

@ -22,7 +22,7 @@ Acked-by: Antonio Quartulli <a@unstable.cc>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/07b6051ebcfaa7ea89b4f278eca2ff4070d29e56 Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/07b6051ebcfaa7ea89b4f278eca2ff4070d29e56
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 73bf6a93a3cf1141a34657bf1284893199e04db9..3db8a0278046c0a9f4d2604f0067ba4efe3ef588 100644 index 0b7b36fa0d5cd440ddef141ad27acfe7b20aee43..36f244125d24c800d35249af7639d39a516588d4 100644
--- a/net/batman-adv/bat_iv_ogm.c --- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c
@@ -463,17 +463,23 @@ static u8 batadv_hop_penalty(u8 tq, const struct batadv_priv *bat_priv) @@ -463,17 +463,23 @@ static u8 batadv_hop_penalty(u8 tq, const struct batadv_priv *bat_priv)

View file

@ -101,10 +101,10 @@ index d241ccc0ca0278173853512c8aa4bfb8b041f996..a9f949501ff3c354d38e3ad333901310
ogm_buff = kzalloc(bat_priv->bat_v.ogm_buff_len, GFP_ATOMIC); ogm_buff = kzalloc(bat_priv->bat_v.ogm_buff_len, GFP_ATOMIC);
if (!ogm_buff) if (!ogm_buff)
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 476b052ad9824d4cbcd6218dce40b603e3400fd2..8eaec92aff8919f0c6ca6b05be22e592b7ae0e1a 100644 index 86f37db7dd01592aff95ada5ba5441667971e1bc..3392198ff146ba77d320104663e97ab21559d556 100644
--- a/net/batman-adv/types.h --- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h +++ b/net/batman-adv/types.h
@@ -1474,10 +1474,10 @@ struct batadv_softif_vlan { @@ -1479,10 +1479,10 @@ struct batadv_softif_vlan {
* struct batadv_priv_bat_v - B.A.T.M.A.N. V per soft-interface private data * struct batadv_priv_bat_v - B.A.T.M.A.N. V per soft-interface private data
*/ */
struct batadv_priv_bat_v { struct batadv_priv_bat_v {

View file

@ -21,7 +21,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/9b8ceef26c697d0c8319748428944c3339a498dc Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/9b8ceef26c697d0c8319748428944c3339a498dc
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 3db8a0278046c0a9f4d2604f0067ba4efe3ef588..cb27949f4086643ebd018a0a01ab0b848ce5123f 100644 index 36f244125d24c800d35249af7639d39a516588d4..5b2ef12cfabb24ccbe2c1848cfff4d1ded9bd0b0 100644
--- a/net/batman-adv/bat_iv_ogm.c --- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c
@@ -42,6 +42,7 @@ @@ -42,6 +42,7 @@
@ -118,7 +118,7 @@ index 3db8a0278046c0a9f4d2604f0067ba4efe3ef588..cb27949f4086643ebd018a0a01ab0b84
struct batadv_hard_iface *if_incoming) struct batadv_hard_iface *if_incoming)
{ {
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 8eaec92aff8919f0c6ca6b05be22e592b7ae0e1a..d43f1ec4532d1fda1d50061e581f4770a6037739 100644 index 3392198ff146ba77d320104663e97ab21559d556..49e4e6cb506f192e85e96e8b3e68be3fdc2dca57 100644
--- a/net/batman-adv/types.h --- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h +++ b/net/batman-adv/types.h
@@ -82,10 +82,10 @@ enum batadv_dhcp_recipient { @@ -82,10 +82,10 @@ enum batadv_dhcp_recipient {

View file

@ -104,7 +104,7 @@ index a9f949501ff3c354d38e3ad333901310391f27d8..bf9ea404abe7cbe1dd2113881856cd35
+ mutex_unlock(&bat_priv->bat_v.ogm_buff_mutex); + mutex_unlock(&bat_priv->bat_v.ogm_buff_mutex);
} }
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index d43f1ec4532d1fda1d50061e581f4770a6037739..05542a32f8c9c00b9d0cd7dbbab60cb773724613 100644 index 49e4e6cb506f192e85e96e8b3e68be3fdc2dca57..44c423447fe163eb3b9df5ec5cf229bed6b8d65b 100644
--- a/net/batman-adv/types.h --- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h +++ b/net/batman-adv/types.h
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
@ -115,7 +115,7 @@ index d43f1ec4532d1fda1d50061e581f4770a6037739..05542a32f8c9c00b9d0cd7dbbab60cb7
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/netlink.h> #include <linux/netlink.h>
#include <linux/sched.h> /* for linux/wait.h */ #include <linux/sched.h> /* for linux/wait.h */
@@ -1474,15 +1475,18 @@ struct batadv_softif_vlan { @@ -1479,15 +1480,18 @@ struct batadv_softif_vlan {
* struct batadv_priv_bat_v - B.A.T.M.A.N. V per soft-interface private data * struct batadv_priv_bat_v - B.A.T.M.A.N. V per soft-interface private data
*/ */
struct batadv_priv_bat_v { struct batadv_priv_bat_v {

View file

@ -25,7 +25,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/d3be478f1aa27b47f61c4a62e18eb063d47c9168 Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/d3be478f1aa27b47f61c4a62e18eb063d47c9168
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index cb27949f4086643ebd018a0a01ab0b848ce5123f..b87bf2e511e0cd702a94594b8ddfe107ee17cef2 100644 index 5b2ef12cfabb24ccbe2c1848cfff4d1ded9bd0b0..f5941837c3ad463f276cffdb25f9b6cd87af0e92 100644
--- a/net/batman-adv/bat_iv_ogm.c --- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
@ -217,10 +217,10 @@ index cb27949f4086643ebd018a0a01ab0b848ce5123f..b87bf2e511e0cd702a94594b8ddfe107
struct batadv_hard_iface *if_incoming) struct batadv_hard_iface *if_incoming)
{ {
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 2f0d42f2f913e74cf10c0c6ce89320434994cac5..48123e9e3a6d221a9033bc2949e19a306e973546 100644 index 36f0962040d16af4f9ed82629ff03ce85c83ed57..c4e0435c952db87c89727633c184320820812cda 100644
--- a/net/batman-adv/hard-interface.c --- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c
@@ -30,6 +30,7 @@ @@ -29,6 +29,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/kref.h> #include <linux/kref.h>
#include <linux/list.h> #include <linux/list.h>
@ -228,7 +228,7 @@ index 2f0d42f2f913e74cf10c0c6ce89320434994cac5..48123e9e3a6d221a9033bc2949e19a30
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/printk.h> #include <linux/printk.h>
#include <linux/rculist.h> #include <linux/rculist.h>
@@ -929,6 +930,7 @@ batadv_hardif_add_interface(struct net_device *net_dev) @@ -933,6 +934,7 @@ batadv_hardif_add_interface(struct net_device *net_dev)
INIT_LIST_HEAD(&hard_iface->list); INIT_LIST_HEAD(&hard_iface->list);
INIT_HLIST_HEAD(&hard_iface->neigh_list); INIT_HLIST_HEAD(&hard_iface->neigh_list);
@ -237,7 +237,7 @@ index 2f0d42f2f913e74cf10c0c6ce89320434994cac5..48123e9e3a6d221a9033bc2949e19a30
kref_init(&hard_iface->refcount); kref_init(&hard_iface->refcount);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 05542a32f8c9c00b9d0cd7dbbab60cb773724613..c843a69677d1e0eefaf6a1432541052b7cd2965a 100644 index 44c423447fe163eb3b9df5ec5cf229bed6b8d65b..85f52dc42e17f7ed550f13048a2e2bd9d372196b 100644
--- a/net/batman-adv/types.h --- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h +++ b/net/batman-adv/types.h
@@ -83,14 +83,17 @@ enum batadv_dhcp_recipient { @@ -83,14 +83,17 @@ enum batadv_dhcp_recipient {

View file

@ -0,0 +1,43 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Thu, 28 Nov 2019 12:43:49 +0100
Subject: batman-adv: Fix DAT candidate selection on little endian systems
The distributed arp table is using a DHT to store and retrieve MAC address
information for an IP address. This is done using unicast messages to
selected peers. The potential peers are looked up using the IP address and
the VID.
While the IP address is always stored in big endian byte order, it is not
the case of the VID. It can (depending on the host system) either be big
endian or little endian. The host must therefore always convert it to big
endian to ensure that all devices calculate the same peers for the same
lookup data.
Fixes: 3e26722bc9f2 ("batman-adv: make the Distributed ARP Table vlan aware")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Acked-by: Antonio Quartulli <a@unstable.cc>
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/728aea06f38e0e4d70f4f7d43698187f7f7055c5
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index a60bacf7120be88ba7626cf0a87dd34eef0a2eec..21783805a3afd974cebc7e640249402d637d731a 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -251,6 +251,7 @@ static u32 batadv_hash_dat(const void *data, u32 size)
u32 hash = 0;
const struct batadv_dat_entry *dat = data;
const unsigned char *key;
+ __be16 vid;
u32 i;
key = (const unsigned char *)&dat->ip;
@@ -260,7 +261,8 @@ static u32 batadv_hash_dat(const void *data, u32 size)
hash ^= (hash >> 6);
}
- key = (const unsigned char *)&dat->vid;
+ vid = htons(dat->vid);
+ key = (__force const unsigned char *)&vid;
for (i = 0; i < sizeof(dat->vid); i++) {
hash += key[i];
hash += (hash << 10);