batman-adv: upgrade package to latest release 2013.2.0
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
This commit is contained in:
parent
b2ff4782d0
commit
a6d6fa15cd
9 changed files with 161 additions and 1763 deletions
|
@ -14,6 +14,11 @@ config KMOD_BATMAN_ADV_DAT
|
|||
depends on PACKAGE_kmod-batman-adv
|
||||
default y
|
||||
|
||||
config KMOD_BATMAN_ADV_NC
|
||||
bool "enable network coding [requires promisc mode support]"
|
||||
depends on PACKAGE_kmod-batman-adv
|
||||
default n
|
||||
|
||||
config KMOD_BATMAN_ADV_BATCTL
|
||||
bool "enable batctl"
|
||||
depends on PACKAGE_kmod-batman-adv
|
||||
|
|
|
@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=batman-adv
|
||||
|
||||
PKG_VERSION:=2013.1.0
|
||||
BATCTL_VERSION:=2013.1.0
|
||||
PKG_RELEASE:=3
|
||||
PKG_MD5SUM:=fe1fd32eddde1f91575d7a7ec21d5782
|
||||
BATCTL_MD5SUM:=767bf36c77c517e1d321169bf9a7fae5
|
||||
PKG_VERSION:=2013.2.0
|
||||
BATCTL_VERSION:=2013.2.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=9ec18300b96df22f0ed21c9f51e4ccef
|
||||
BATCTL_MD5SUM:=712f86cdd0f9076503fc48acf37e109e
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
|
||||
|
@ -57,6 +57,7 @@ MAKE_BATMAN_ADV_ARGS += \
|
|||
CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),y,n) \
|
||||
CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_BLA),y,n) \
|
||||
CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_KMOD_BATMAN_ADV_DAT),y,n) \
|
||||
CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_NC),y,n) \
|
||||
REVISION="" all
|
||||
|
||||
MAKE_BATCTL_ARGS += \
|
||||
|
|
|
@ -12,6 +12,7 @@ config 'mesh' 'bat0'
|
|||
option 'vis_mode'
|
||||
option 'bridge_loop_avoidance'
|
||||
option 'distributed_arp_table'
|
||||
option 'network_coding'
|
||||
option 'hop_penalty'
|
||||
|
||||
# yet another batX instance
|
||||
|
|
|
@ -5,14 +5,14 @@ bat_load_module()
|
|||
[ -d "/sys/module/batman_adv/" ] && return
|
||||
|
||||
. /lib/functions.sh
|
||||
load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-batman-adv*
|
||||
load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-crypto* /etc/modules.d/*-lib-crc* /etc/modules.d/*-batman-adv*
|
||||
}
|
||||
|
||||
bat_config()
|
||||
{
|
||||
local mesh="$1"
|
||||
local aggregated_ogms ap_isolation bonding bridge_loop_avoidance distributed_arp_table fragmentation
|
||||
local gw_bandwidth gw_mode gw_sel_class hop_penalty log_level orig_interval vis_mode
|
||||
local gw_bandwidth gw_mode gw_sel_class hop_penalty network_coding log_level orig_interval vis_mode
|
||||
|
||||
config_get aggregated_ogms "$mesh" aggregated_ogms
|
||||
config_get ap_isolation "$mesh" ap_isolation
|
||||
|
@ -24,6 +24,7 @@ bat_config()
|
|||
config_get gw_mode "$mesh" gw_mode
|
||||
config_get gw_sel_class "$mesh" gw_sel_class
|
||||
config_get hop_penalty "$mesh" hop_penalty
|
||||
config_get network_coding "$mesh" network_coding
|
||||
config_get log_level "$mesh" log_level
|
||||
config_get orig_interval "$mesh" orig_interval
|
||||
config_get vis_mode "$mesh" vis_mode
|
||||
|
@ -33,13 +34,14 @@ bat_config()
|
|||
[ -n "$aggregate_ogms" ] && echo $aggregate_ogms > /sys/class/net/$mesh/mesh/aggregate_ogms
|
||||
[ -n "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation
|
||||
[ -n "$bonding" ] && echo $bonding > /sys/class/net/$mesh/mesh/bonding
|
||||
[ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance
|
||||
[ -n "$distributed_arp_table" ] && echo $distributed_arp_table > /sys/class/net/$mesh/mesh/distributed_arp_table
|
||||
[ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance 2>&-
|
||||
[ -n "$distributed_arp_table" ] && echo $distributed_arp_table > /sys/class/net/$mesh/mesh/distributed_arp_table 2>&-
|
||||
[ -n "$fragmentation" ] && echo $fragmentation > /sys/class/net/$mesh/mesh/fragmentation
|
||||
[ -n "$gw_bandwidth" ] && echo $gw_bandwidth > /sys/class/net/$mesh/mesh/gw_bandwidth
|
||||
[ -n "$gw_mode" ] && echo $gw_mode > /sys/class/net/$mesh/mesh/gw_mode
|
||||
[ -n "$gw_sel_class" ] && echo $gw_sel_class > /sys/class/net/$mesh/mesh/gw_sel_class
|
||||
[ -n "$hop_penalty" ] && echo $hop_penalty > /sys/class/net/$mesh/mesh/hop_penalty
|
||||
[ -n "$network_coding" ] && echo $network_coding > /sys/class/net/$mesh/mesh/network_coding 2>&-
|
||||
[ -n "$log_level" ] && echo $log_level > /sys/class/net/$mesh/mesh/log_level 2>&-
|
||||
[ -n "$orig_interval" ] && echo $orig_interval > /sys/class/net/$mesh/mesh/orig_interval
|
||||
[ -n "$vis_mode" ] && echo $vis_mode > /sys/class/net/$mesh/mesh/vis_mode
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
From 9b96ecbae7295269aaa0320667f646870de65661 Mon Sep 17 00:00:00 2001
|
||||
From: Antonio Quartulli <antonio@open-mesh.com>
|
||||
Date: Wed, 3 Apr 2013 10:14:20 +0200
|
||||
Subject: [PATCH 1/2] batman-adv: use the proper header len when checking the
|
||||
TTVN
|
||||
|
||||
Unicast packet might be of type either UNICAST or
|
||||
UNICAST4ADDR.
|
||||
In the two cases the header size is different, but the
|
||||
mechanism checking the TTVN field was assuming it to be
|
||||
always of the same type (UNICAST), so failing to access the
|
||||
inner Ethernet header in case of UNICAST4ADDR.
|
||||
|
||||
Fix this by passing the real header length as argument.
|
||||
|
||||
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
|
||||
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||
---
|
||||
routing.c | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/routing.c b/routing.c
|
||||
index 2f1f889..b27a4d7 100644
|
||||
--- a/routing.c
|
||||
+++ b/routing.c
|
||||
@@ -939,7 +939,7 @@ out:
|
||||
}
|
||||
|
||||
static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv,
|
||||
- struct sk_buff *skb) {
|
||||
+ struct sk_buff *skb, int hdr_len) {
|
||||
uint8_t curr_ttvn, old_ttvn;
|
||||
struct batadv_orig_node *orig_node;
|
||||
struct ethhdr *ethhdr;
|
||||
@@ -948,7 +948,7 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv,
|
||||
int is_old_ttvn;
|
||||
|
||||
/* check if there is enough data before accessing it */
|
||||
- if (pskb_may_pull(skb, sizeof(*unicast_packet) + ETH_HLEN) < 0)
|
||||
+ if (pskb_may_pull(skb, hdr_len + ETH_HLEN) < 0)
|
||||
return 0;
|
||||
|
||||
/* create a copy of the skb (in case of for re-routing) to modify it. */
|
||||
@@ -956,7 +956,7 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv,
|
||||
return 0;
|
||||
|
||||
unicast_packet = (struct batadv_unicast_packet *)skb->data;
|
||||
- ethhdr = (struct ethhdr *)(skb->data + sizeof(*unicast_packet));
|
||||
+ ethhdr = (struct ethhdr *)(skb->data + hdr_len);
|
||||
|
||||
/* check if the destination client was served by this node and it is now
|
||||
* roaming. In this case, it means that the node has got a ROAM_ADV
|
||||
@@ -1072,8 +1072,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
|
||||
|
||||
if (check < 0)
|
||||
return NET_RX_DROP;
|
||||
-
|
||||
- if (!batadv_check_unicast_ttvn(bat_priv, skb))
|
||||
+ if (!batadv_check_unicast_ttvn(bat_priv, skb, hdr_size))
|
||||
return NET_RX_DROP;
|
||||
|
||||
/* packet for me */
|
||||
@@ -1117,7 +1116,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
|
||||
if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
|
||||
return NET_RX_DROP;
|
||||
|
||||
- if (!batadv_check_unicast_ttvn(bat_priv, skb))
|
||||
+ if (!batadv_check_unicast_ttvn(bat_priv, skb, hdr_size))
|
||||
return NET_RX_DROP;
|
||||
|
||||
unicast_packet = (struct batadv_unicast_frag_packet *)skb->data;
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
From e56c79f4e863436d0fc6c48fed0db09b7a49e565 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Lindner <lindner_marek@yahoo.de>
|
||||
Date: Mon, 4 Mar 2013 10:39:49 +0800
|
||||
Subject: [PATCH 1/3] batman-adv: verify tt len does not exceed packet len
|
||||
|
||||
batadv_iv_ogm_process() accesses the packet using the tt_num_changes
|
||||
attribute regardless of the real packet len (assuming the length check
|
||||
was done before). Therefore a length check is needed to avoid reading
|
||||
random memory.
|
||||
|
||||
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||
---
|
||||
bat_iv_ogm.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
|
||||
index 72fe1bb..d5be889 100644
|
||||
--- a/bat_iv_ogm.c
|
||||
+++ b/bat_iv_ogm.c
|
||||
@@ -1292,7 +1292,8 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
|
||||
batadv_ogm_packet = (struct batadv_ogm_packet *)packet_buff;
|
||||
|
||||
/* unpack the aggregated packets and process them one by one */
|
||||
- do {
|
||||
+ while (batadv_iv_ogm_aggr_packet(buff_pos, packet_len,
|
||||
+ batadv_ogm_packet->tt_num_changes)) {
|
||||
tt_buff = packet_buff + buff_pos + BATADV_OGM_HLEN;
|
||||
|
||||
batadv_iv_ogm_process(ethhdr, batadv_ogm_packet, tt_buff,
|
||||
@@ -1303,8 +1304,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
|
||||
|
||||
packet_pos = packet_buff + buff_pos;
|
||||
batadv_ogm_packet = (struct batadv_ogm_packet *)packet_pos;
|
||||
- } while (batadv_iv_ogm_aggr_packet(buff_pos, packet_len,
|
||||
- batadv_ogm_packet->tt_num_changes));
|
||||
+ }
|
||||
|
||||
kfree_skb(skb);
|
||||
return NET_RX_SUCCESS;
|
||||
--
|
||||
1.7.10.4
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,69 @@
|
|||
From 82d1a8ebf19a1b9841ee44ce7b2448114be3e772 Mon Sep 17 00:00:00 2001
|
||||
From: Patrick McHardy <kaber@trash.net>
|
||||
Date: Wed, 24 Apr 2013 17:42:56 +0200
|
||||
Subject: [PATCH 2/2] net: vlan: add protocol argument to packet tagging
|
||||
functions
|
||||
|
||||
Add a protocol argument to the VLAN packet tagging functions. In case of HW
|
||||
tagging, we need that protocol available in the ndo_start_xmit functions,
|
||||
so it is stored in a new field in the skb. The new field fits into a hole
|
||||
(on 64 bit) and doesn't increase the sks's size.
|
||||
|
||||
Signed-off-by: Patrick McHardy <kaber@trash.net>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
[siwu@hrz.tu-chemnitz.de: added compat code]
|
||||
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
|
||||
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||
---
|
||||
bridge_loop_avoidance.c | 2 +-
|
||||
compat.h | 16 +++++++++++++++-
|
||||
2 files changed, 16 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
|
||||
index 6a4f728..379061c 100644
|
||||
--- a/bridge_loop_avoidance.c
|
||||
+++ b/bridge_loop_avoidance.c
|
||||
@@ -341,7 +341,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
|
||||
}
|
||||
|
||||
if (vid != -1)
|
||||
- skb = vlan_insert_tag(skb, vid);
|
||||
+ skb = vlan_insert_tag(skb, htons(ETH_P_8021Q), vid);
|
||||
|
||||
skb_reset_mac_header(skb);
|
||||
skb->protocol = eth_type_trans(skb, soft_iface);
|
||||
diff --git a/compat.h b/compat.h
|
||||
index 0663df5..c1dadac 100644
|
||||
--- a/compat.h
|
||||
+++ b/compat.h
|
||||
@@ -170,7 +170,7 @@ static const struct { \
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
|
||||
|
||||
#define kfree_rcu(ptr, rcu_head) call_rcu(&ptr->rcu_head, batadv_free_rcu_##ptr)
|
||||
-#define vlan_insert_tag(skb, vid) __vlan_put_tag(skb, vid)
|
||||
+#define vlan_insert_tag(skb, proto, vid) __vlan_put_tag(skb, vid)
|
||||
|
||||
void batadv_free_rcu_gw_node(struct rcu_head *rcu);
|
||||
void batadv_free_rcu_neigh_node(struct rcu_head *rcu);
|
||||
@@ -278,4 +278,18 @@ static int __batadv_interface_set_mac_addr(x, y)
|
||||
|
||||
#endif /* < KERNEL_VERSION(3, 9, 0) */
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
||||
+
|
||||
+#ifndef vlan_insert_tag
|
||||
+
|
||||
+/* include this header early to let the following define
|
||||
+ * not mess up the original function prototype.
|
||||
+ */
|
||||
+#include <linux/if_vlan.h>
|
||||
+#define vlan_insert_tag(skb, proto, vid) vlan_insert_tag(skb, vid)
|
||||
+
|
||||
+#endif /* vlan_insert_tag */
|
||||
+
|
||||
+#endif /* < KERNEL_VERSION(3, 10, 0) */
|
||||
+
|
||||
#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,250 +0,0 @@
|
|||
From 647d23f3e358d9fa4b1a8f0bb67a3e6bff30d4a1 Mon Sep 17 00:00:00 2001
|
||||
From: Antonio Quartulli <ordex@autistici.org>
|
||||
Date: Wed, 3 Apr 2013 19:10:26 +0200
|
||||
Subject: [PATCH 3/3] batman-adv: make is_my_mac() check for the current mesh
|
||||
only
|
||||
|
||||
On a multi-mesh node (a node running more than one batman-adv
|
||||
virtual interface) batadv_is_my_mac() has to check MAC
|
||||
addresses of hard interfaces belonging to the current mesh
|
||||
only.
|
||||
|
||||
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
|
||||
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||
---
|
||||
main.c | 5 ++++-
|
||||
main.h | 2 +-
|
||||
routing.c | 38 ++++++++++++++++++++------------------
|
||||
translation-table.c | 2 +-
|
||||
vis.c | 4 ++--
|
||||
5 files changed, 28 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/main.c b/main.c
|
||||
index 0488d70..fa563e4 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -169,7 +169,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
|
||||
atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
|
||||
}
|
||||
|
||||
-int batadv_is_my_mac(const uint8_t *addr)
|
||||
+int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr)
|
||||
{
|
||||
const struct batadv_hard_iface *hard_iface;
|
||||
|
||||
@@ -178,6 +178,9 @@ int batadv_is_my_mac(const uint8_t *addr)
|
||||
if (hard_iface->if_status != BATADV_IF_ACTIVE)
|
||||
continue;
|
||||
|
||||
+ if (hard_iface->soft_iface != bat_priv->soft_iface)
|
||||
+ continue;
|
||||
+
|
||||
if (batadv_compare_eth(hard_iface->net_dev->dev_addr, addr)) {
|
||||
rcu_read_unlock();
|
||||
return 1;
|
||||
diff --git a/main.h b/main.h
|
||||
index 08c5dd1..fcb5d65 100644
|
||||
--- a/main.h
|
||||
+++ b/main.h
|
||||
@@ -164,7 +164,7 @@ extern struct workqueue_struct *batadv_event_workqueue;
|
||||
|
||||
int batadv_mesh_init(struct net_device *soft_iface);
|
||||
void batadv_mesh_free(struct net_device *soft_iface);
|
||||
-int batadv_is_my_mac(const uint8_t *addr);
|
||||
+int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr);
|
||||
struct batadv_hard_iface *
|
||||
batadv_seq_print_text_primary_if_get(struct seq_file *seq);
|
||||
int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
|
||||
diff --git a/routing.c b/routing.c
|
||||
index 5ee21ce..319f290 100644
|
||||
--- a/routing.c
|
||||
+++ b/routing.c
|
||||
@@ -402,7 +402,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
|
||||
goto out;
|
||||
|
||||
/* not for me */
|
||||
- if (!batadv_is_my_mac(ethhdr->h_dest))
|
||||
+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
|
||||
goto out;
|
||||
|
||||
icmp_packet = (struct batadv_icmp_packet_rr *)skb->data;
|
||||
@@ -416,7 +416,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
/* packet for me */
|
||||
- if (batadv_is_my_mac(icmp_packet->dst))
|
||||
+ if (batadv_is_my_mac(bat_priv, icmp_packet->dst))
|
||||
return batadv_recv_my_icmp_packet(bat_priv, skb, hdr_size);
|
||||
|
||||
/* TTL exceeded */
|
||||
@@ -548,7 +548,8 @@ batadv_find_ifalter_router(struct batadv_orig_node *primary_orig,
|
||||
return router;
|
||||
}
|
||||
|
||||
-static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
|
||||
+static int batadv_check_unicast_packet(struct batadv_priv *bat_priv,
|
||||
+ struct sk_buff *skb, int hdr_size)
|
||||
{
|
||||
struct ethhdr *ethhdr;
|
||||
|
||||
@@ -567,7 +568,7 @@ static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
|
||||
return -1;
|
||||
|
||||
/* not for me */
|
||||
- if (!batadv_is_my_mac(ethhdr->h_dest))
|
||||
+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@@ -582,7 +583,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct batadv_hard_iface *recv_if)
|
||||
char tt_flag;
|
||||
size_t packet_size;
|
||||
|
||||
- if (batadv_check_unicast_packet(skb, hdr_size) < 0)
|
||||
+ if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
|
||||
return NET_RX_DROP;
|
||||
|
||||
/* I could need to modify it */
|
||||
@@ -614,7 +615,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct batadv_hard_iface *recv_if)
|
||||
case BATADV_TT_RESPONSE:
|
||||
batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_RX);
|
||||
|
||||
- if (batadv_is_my_mac(tt_query->dst)) {
|
||||
+ if (batadv_is_my_mac(bat_priv, tt_query->dst)) {
|
||||
/* packet needs to be linearized to access the TT
|
||||
* changes
|
||||
*/
|
||||
@@ -657,14 +658,15 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct batadv_hard_iface *recv_if)
|
||||
struct batadv_roam_adv_packet *roam_adv_packet;
|
||||
struct batadv_orig_node *orig_node;
|
||||
|
||||
- if (batadv_check_unicast_packet(skb, sizeof(*roam_adv_packet)) < 0)
|
||||
+ if (batadv_check_unicast_packet(bat_priv, skb,
|
||||
+ sizeof(*roam_adv_packet)) < 0)
|
||||
goto out;
|
||||
|
||||
batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
|
||||
|
||||
roam_adv_packet = (struct batadv_roam_adv_packet *)skb->data;
|
||||
|
||||
- if (!batadv_is_my_mac(roam_adv_packet->dst))
|
||||
+ if (!batadv_is_my_mac(bat_priv, roam_adv_packet->dst))
|
||||
return batadv_route_unicast_packet(skb, recv_if);
|
||||
|
||||
/* check if it is a backbone gateway. we don't accept
|
||||
@@ -967,7 +969,7 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv,
|
||||
* last time) the packet had an updated information or not
|
||||
*/
|
||||
curr_ttvn = (uint8_t)atomic_read(&bat_priv->tt.vn);
|
||||
- if (!batadv_is_my_mac(unicast_packet->dest)) {
|
||||
+ if (!batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
|
||||
orig_node = batadv_orig_hash_find(bat_priv,
|
||||
unicast_packet->dest);
|
||||
/* if it is not possible to find the orig_node representing the
|
||||
@@ -1044,14 +1046,14 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
|
||||
if (is4addr)
|
||||
hdr_size = sizeof(*unicast_4addr_packet);
|
||||
|
||||
- if (batadv_check_unicast_packet(skb, hdr_size) < 0)
|
||||
+ if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
|
||||
return NET_RX_DROP;
|
||||
|
||||
if (!batadv_check_unicast_ttvn(bat_priv, skb))
|
||||
return NET_RX_DROP;
|
||||
|
||||
/* packet for me */
|
||||
- if (batadv_is_my_mac(unicast_packet->dest)) {
|
||||
+ if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
|
||||
if (is4addr) {
|
||||
batadv_dat_inc_counter(bat_priv,
|
||||
unicast_4addr_packet->subtype);
|
||||
@@ -1088,7 +1090,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
|
||||
struct sk_buff *new_skb = NULL;
|
||||
int ret;
|
||||
|
||||
- if (batadv_check_unicast_packet(skb, hdr_size) < 0)
|
||||
+ if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
|
||||
return NET_RX_DROP;
|
||||
|
||||
if (!batadv_check_unicast_ttvn(bat_priv, skb))
|
||||
@@ -1097,7 +1099,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
|
||||
unicast_packet = (struct batadv_unicast_frag_packet *)skb->data;
|
||||
|
||||
/* packet for me */
|
||||
- if (batadv_is_my_mac(unicast_packet->dest)) {
|
||||
+ if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
|
||||
ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
|
||||
|
||||
if (ret == NET_RX_DROP)
|
||||
@@ -1151,13 +1153,13 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
|
||||
goto out;
|
||||
|
||||
/* ignore broadcasts sent by myself */
|
||||
- if (batadv_is_my_mac(ethhdr->h_source))
|
||||
+ if (batadv_is_my_mac(bat_priv, ethhdr->h_source))
|
||||
goto out;
|
||||
|
||||
bcast_packet = (struct batadv_bcast_packet *)skb->data;
|
||||
|
||||
/* ignore broadcasts originated by myself */
|
||||
- if (batadv_is_my_mac(bcast_packet->orig))
|
||||
+ if (batadv_is_my_mac(bat_priv, bcast_packet->orig))
|
||||
goto out;
|
||||
|
||||
if (bcast_packet->header.ttl < 2)
|
||||
@@ -1243,14 +1245,14 @@ int batadv_recv_vis_packet(struct sk_buff *skb,
|
||||
ethhdr = (struct ethhdr *)skb_mac_header(skb);
|
||||
|
||||
/* not for me */
|
||||
- if (!batadv_is_my_mac(ethhdr->h_dest))
|
||||
+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
|
||||
return NET_RX_DROP;
|
||||
|
||||
/* ignore own packets */
|
||||
- if (batadv_is_my_mac(vis_packet->vis_orig))
|
||||
+ if (batadv_is_my_mac(bat_priv, vis_packet->vis_orig))
|
||||
return NET_RX_DROP;
|
||||
|
||||
- if (batadv_is_my_mac(vis_packet->sender_orig))
|
||||
+ if (batadv_is_my_mac(bat_priv, vis_packet->sender_orig))
|
||||
return NET_RX_DROP;
|
||||
|
||||
switch (vis_packet->vis_type) {
|
||||
diff --git a/translation-table.c b/translation-table.c
|
||||
index 98a66a0..7abee19 100644
|
||||
--- a/translation-table.c
|
||||
+++ b/translation-table.c
|
||||
@@ -1953,7 +1953,7 @@ out:
|
||||
bool batadv_send_tt_response(struct batadv_priv *bat_priv,
|
||||
struct batadv_tt_query_packet *tt_request)
|
||||
{
|
||||
- if (batadv_is_my_mac(tt_request->dst)) {
|
||||
+ if (batadv_is_my_mac(bat_priv, tt_request->dst)) {
|
||||
/* don't answer backbone gws! */
|
||||
if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_request->src))
|
||||
return true;
|
||||
diff --git a/vis.c b/vis.c
|
||||
index c053244..6a1e646 100644
|
||||
--- a/vis.c
|
||||
+++ b/vis.c
|
||||
@@ -477,7 +477,7 @@ void batadv_receive_client_update_packet(struct batadv_priv *bat_priv,
|
||||
|
||||
/* Are we the target for this VIS packet? */
|
||||
if (vis_server == BATADV_VIS_TYPE_SERVER_SYNC &&
|
||||
- batadv_is_my_mac(vis_packet->target_orig))
|
||||
+ batadv_is_my_mac(bat_priv, vis_packet->target_orig))
|
||||
are_target = 1;
|
||||
|
||||
spin_lock_bh(&bat_priv->vis.hash_lock);
|
||||
@@ -496,7 +496,7 @@ void batadv_receive_client_update_packet(struct batadv_priv *bat_priv,
|
||||
batadv_send_list_add(bat_priv, info);
|
||||
|
||||
/* ... we're not the recipient (and thus need to forward). */
|
||||
- } else if (!batadv_is_my_mac(packet->target_orig)) {
|
||||
+ } else if (!batadv_is_my_mac(bat_priv, packet->target_orig)) {
|
||||
batadv_send_list_add(bat_priv, info);
|
||||
}
|
||||
|
||||
--
|
||||
1.7.10.4
|
||||
|
Loading…
Reference in a new issue