Add updated batman-adv package
This commit is contained in:
parent
1f39495778
commit
ff5308ab2c
|
@ -0,0 +1,24 @@
|
||||||
|
|
||||||
|
config KMOD_BATMAN_ADV_DEBUG_LOG
|
||||||
|
bool "enable verbose debug logging"
|
||||||
|
depends PACKAGE_kmod-batman-adv
|
||||||
|
default n
|
||||||
|
|
||||||
|
config KMOD_BATMAN_ADV_BLA
|
||||||
|
bool "enable bridge loop avoidance"
|
||||||
|
depends PACKAGE_kmod-batman-adv
|
||||||
|
default y
|
||||||
|
|
||||||
|
config KMOD_BATMAN_ADV_DAT
|
||||||
|
bool "enable distributed arp table"
|
||||||
|
depends PACKAGE_kmod-batman-adv
|
||||||
|
default y
|
||||||
|
|
||||||
|
config KMOD_BATMAN_ADV_BATCTL
|
||||||
|
bool "enable batctl"
|
||||||
|
depends PACKAGE_kmod-batman-adv
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
|
||||||
|
It is an easier method for configuring batman-adv and
|
||||||
|
provides some additional tools for debugging as well.
|
|
@ -0,0 +1,122 @@
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010 OpenWrt.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=batman-adv
|
||||||
|
|
||||||
|
PKG_VERSION:=2013.0.0
|
||||||
|
BATCTL_VERSION:=2013.0.0
|
||||||
|
PKG_RELEASE:=2
|
||||||
|
PKG_MD5SUM:=37f4aa02f393daad3d87cead2bc28ed9
|
||||||
|
BATCTL_MD5SUM:=6ea4bcd8a9332d586bb06b5063f882cd
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
|
||||||
|
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
|
PKG_BATCTL_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/batctl-$(BATCTL_VERSION)
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
|
define KernelPackage/batman-adv
|
||||||
|
URL:=http://www.open-mesh.org/
|
||||||
|
MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
|
||||||
|
SUBMENU:=Network Support
|
||||||
|
DEPENDS:=+kmod-lib-crc16 +kmod-crypto-core +kmod-crypto-crc32c +kmod-lib-crc32c +libc
|
||||||
|
TITLE:=B.A.T.M.A.N. Adv
|
||||||
|
FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
|
||||||
|
AUTOLOAD:=$(call AutoLoad,50,batman-adv)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/batman-adv/description
|
||||||
|
B.A.T.M.A.N. advanced is a kernel module which allows to
|
||||||
|
build layer 2 mesh networks. This package contains the
|
||||||
|
version $(PKG_VERSION) of the kernel module plus its user space
|
||||||
|
configuration & managerment tool batctl.
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/batman-adv/config
|
||||||
|
source "$(SOURCE)/Config.in"
|
||||||
|
endef
|
||||||
|
|
||||||
|
MAKE_BATMAN_ADV_ARGS += \
|
||||||
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||||
|
KERNELPATH="$(LINUX_DIR)" \
|
||||||
|
ARCH="$(LINUX_KARCH)" \
|
||||||
|
PATH="$(TARGET_PATH)" \
|
||||||
|
SUBDIRS="$(PKG_BUILD_DIR)" \
|
||||||
|
PWD="$(PKG_BUILD_DIR)" \
|
||||||
|
LINUX_VERSION="$(LINUX_VERSION)" \
|
||||||
|
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) \
|
||||||
|
REVISION="" all
|
||||||
|
|
||||||
|
MAKE_BATCTL_ARGS += \
|
||||||
|
CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
CCFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
OFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
REVISION="" \
|
||||||
|
CC="$(TARGET_CC)" \
|
||||||
|
NODEBUG=1 \
|
||||||
|
UNAME="Linux" \
|
||||||
|
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||||
|
STRIP="/bin/true" \
|
||||||
|
batctl install
|
||||||
|
|
||||||
|
ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
|
||||||
|
define Download/batctl
|
||||||
|
FILE:=batctl-$(BATCTL_VERSION).tar.gz
|
||||||
|
URL:=$(PKG_SOURCE_URL)
|
||||||
|
MD5SUM:=$(BATCTL_MD5SUM)
|
||||||
|
endef
|
||||||
|
$(eval $(call Download,batctl))
|
||||||
|
|
||||||
|
BATCTL_EXTRACT = tar xzf "$(DL_DIR)/batctl-$(BATCTL_VERSION).tar.gz" -C "$(BUILD_DIR)/$(PKG_NAME)"
|
||||||
|
BATCTL_PATCH = $(call Build/DoPatch,"$(PKG_BATCTL_BUILD_DIR)","$(PATCH_DIR)","*batctl*")
|
||||||
|
BATCTL_BUILD = $(MAKE) -C $(PKG_BATCTL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
|
||||||
|
BATCTL_INSTALL = $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/batctl $(1)/usr/sbin/
|
||||||
|
endif
|
||||||
|
|
||||||
|
KPATCH ?= $(PATCH)
|
||||||
|
define Build/DoPatch
|
||||||
|
@if [ -d "$(2)" ]; then \
|
||||||
|
if [ "$$$$(ls $(2) | grep -Ec $(3))" -gt 0 ]; then \
|
||||||
|
$(KPATCH) "$(1)" "$(2)" "$(3)"; \
|
||||||
|
fi; \
|
||||||
|
fi
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Patch
|
||||||
|
$(call Build/DoPatch,"$(PKG_BUILD_DIR)","$(PATCH_DIR)","*batman*")
|
||||||
|
$(BATCTL_EXTRACT)
|
||||||
|
$(BATCTL_PATCH)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
$(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATMAN_ADV_ARGS)
|
||||||
|
$(BATCTL_BUILD)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Clean
|
||||||
|
rm -rf $(BUILD_DIR)/$(PKG_NAME)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define KernelPackage/batman-adv/install
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/net $(1)/etc/hotplug.d/iface $(1)/lib/batman-adv $(1)/usr/sbin $(1)/lib/netifd/proto
|
||||||
|
$(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
|
||||||
|
$(INSTALL_DATA) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv
|
||||||
|
$(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv $(1)/etc/hotplug.d/net
|
||||||
|
$(INSTALL_BIN) ./files/lib/netifd/proto/batadv.sh $(1)/lib/netifd/proto
|
||||||
|
$(INSTALL_BIN) ./files/usr/sbin/batman-adv $(1)/usr/sbin
|
||||||
|
$(BATCTL_INSTALL)
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call KernelPackage,batman-adv))
|
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
config 'mesh' 'bat0'
|
||||||
|
option 'aggregated_ogms'
|
||||||
|
option 'ap_isolation'
|
||||||
|
option 'bonding'
|
||||||
|
option 'fragmentation'
|
||||||
|
option 'gw_bandwidth'
|
||||||
|
option 'gw_mode'
|
||||||
|
option 'gw_sel_class'
|
||||||
|
option 'log_level'
|
||||||
|
option 'orig_interval'
|
||||||
|
option 'vis_mode'
|
||||||
|
option 'bridge_loop_avoidance'
|
||||||
|
option 'distributed_arp_table'
|
||||||
|
option 'hop_penalty'
|
||||||
|
|
||||||
|
# yet another batX instance
|
||||||
|
# config 'mesh' 'bat5'
|
||||||
|
# option 'interfaces' 'second_mesh'
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/batman-adv/config.sh
|
||||||
|
|
||||||
|
bat_load_module
|
||||||
|
config_load batman-adv
|
||||||
|
|
||||||
|
case "$ACTION" in
|
||||||
|
add)
|
||||||
|
[ -d /sys/class/net/$INTERFACE/mesh/ ] && bat_config "$INTERFACE"
|
||||||
|
;;
|
||||||
|
esac
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
bat_load_module()
|
||||||
|
{
|
||||||
|
[ -d "/sys/module/batman_adv/" ] && return
|
||||||
|
|
||||||
|
. /lib/functions.sh
|
||||||
|
load_modules /etc/modules.d/*-crc16 /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
|
||||||
|
|
||||||
|
config_get aggregated_ogms "$mesh" aggregated_ogms
|
||||||
|
config_get ap_isolation "$mesh" ap_isolation
|
||||||
|
config_get bonding "$mesh" bonding
|
||||||
|
config_get bridge_loop_avoidance "$mesh" bridge_loop_avoidance
|
||||||
|
config_get distributed_arp_table "$mesh" distributed_arp_table
|
||||||
|
config_get fragmentation "$mesh" fragmentation
|
||||||
|
config_get gw_bandwidth "$mesh" gw_bandwidth
|
||||||
|
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 log_level "$mesh" log_level
|
||||||
|
config_get orig_interval "$mesh" orig_interval
|
||||||
|
config_get vis_mode "$mesh" vis_mode
|
||||||
|
|
||||||
|
[ ! -f "/sys/class/net/$mesh/mesh/orig_interval" ] && echo "batman-adv mesh $mesh does not exist - check your interface configuration" && return 1
|
||||||
|
|
||||||
|
[ -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 "$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 "$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,30 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /lib/functions.sh
|
||||||
|
. ../netifd-proto.sh
|
||||||
|
init_proto "$@"
|
||||||
|
|
||||||
|
proto_batadv_init_config() {
|
||||||
|
proto_config_add_string "mesh"
|
||||||
|
}
|
||||||
|
|
||||||
|
proto_batadv_setup() {
|
||||||
|
local config="$1"
|
||||||
|
local iface="$2"
|
||||||
|
|
||||||
|
local mesh
|
||||||
|
json_get_vars mesh
|
||||||
|
|
||||||
|
echo "$mesh" > "/sys/class/net/$iface/batman_adv/mesh_iface"
|
||||||
|
proto_init_update "$iface" 1
|
||||||
|
proto_send_update "$config"
|
||||||
|
}
|
||||||
|
|
||||||
|
proto_batadv_teardown() {
|
||||||
|
local config="$1"
|
||||||
|
local iface="$2"
|
||||||
|
|
||||||
|
echo "none" > "/sys/class/net/$iface/batman_adv/mesh_iface" || true
|
||||||
|
}
|
||||||
|
|
||||||
|
add_protocol batadv
|
|
@ -0,0 +1,60 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Copyright (C) 2011 OpenWrt.org
|
||||||
|
|
||||||
|
. /lib/functions.sh
|
||||||
|
. /lib/batman-adv/config.sh
|
||||||
|
|
||||||
|
start_mesh() {
|
||||||
|
local mesh="$1"
|
||||||
|
local ifaces=$(awk -F':' '{if (NR > 2) print $1}' /proc/net/dev)
|
||||||
|
|
||||||
|
for iface in $ifaces; do
|
||||||
|
[ -d /sys/class/net/$iface/batman_adv/ ] && bat_add_interface "$mesh" "$iface"
|
||||||
|
done
|
||||||
|
|
||||||
|
bat_config "$mesh"
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_mesh() {
|
||||||
|
local mesh="$1"
|
||||||
|
local ifaces=$(awk -F':' '{if (NR > 2) print $1}' /proc/net/dev)
|
||||||
|
|
||||||
|
for iface in $ifaces; do
|
||||||
|
[ -d /sys/class/net/$iface/batman_adv/ ] && bat_del_interface "$mesh" "$iface"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# can also be used with "batman-adv start bat0"
|
||||||
|
start() {
|
||||||
|
bat_load_module
|
||||||
|
config_load batman-adv
|
||||||
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
start_mesh $1
|
||||||
|
else
|
||||||
|
config_foreach start_mesh mesh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# can also be used with "batman-adv stop bat0"
|
||||||
|
stop () {
|
||||||
|
config_load batman-adv
|
||||||
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
stop_mesh $1
|
||||||
|
else
|
||||||
|
config_foreach stop_mesh mesh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
stop $1
|
||||||
|
start $1
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start) start $2 ;;
|
||||||
|
stop) stop $2 ;;
|
||||||
|
restart) restart $2 ;;
|
||||||
|
*) echo "Usage: batman-adv <start|stop|restart> [mesh instance]"
|
||||||
|
esac
|
|
@ -0,0 +1,33 @@
|
||||||
|
From 977d8c6f9253ad71e4bd8e4be2705c3bee684feb Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Date: Wed, 23 Jan 2013 18:11:53 +0100
|
||||||
|
Subject: [PATCH 1/3] batman-adv: fix skb leak in
|
||||||
|
batadv_dat_snoop_incoming_arp_reply()
|
||||||
|
|
||||||
|
The callers of batadv_dat_snoop_incoming_arp_reply() assume the skb has been
|
||||||
|
freed when it returns true; fix this by calling kfree_skb before returning as
|
||||||
|
it is done in batadv_dat_snoop_incoming_arp_request().
|
||||||
|
|
||||||
|
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||||
|
Acked-by: Antonio Quartulli <ordex@autistici.org>
|
||||||
|
---
|
||||||
|
distributed-arp-table.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
|
||||||
|
index 7485a78..9f4cff3 100644
|
||||||
|
--- a/distributed-arp-table.c
|
||||||
|
+++ b/distributed-arp-table.c
|
||||||
|
@@ -1012,6 +1012,8 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
|
||||||
|
*/
|
||||||
|
ret = !batadv_is_my_client(bat_priv, hw_dst);
|
||||||
|
out:
|
||||||
|
+ if (ret)
|
||||||
|
+ kfree_skb(skb);
|
||||||
|
/* if ret == false -> packet has to be delivered to the interface */
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.7.10.4
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
From 3b24193d7cfc18f0cc005811ca4aab3479c2f1c6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Date: Thu, 24 Jan 2013 18:18:26 +0100
|
||||||
|
Subject: [PATCH 2/3] batman-adv: check for more types of invalid IP addresses
|
||||||
|
in DAT
|
||||||
|
|
||||||
|
There are more types of IP addresses that may appear in ARP packets that we
|
||||||
|
don't want to process. While some of these should never appear in sane ARP
|
||||||
|
packets, a 0.0.0.0 source is used for duplicate address detection and thus seen
|
||||||
|
quite often.
|
||||||
|
|
||||||
|
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Acked-by: Antonio Quartulli <ordex@autistici.org>
|
||||||
|
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||||
|
---
|
||||||
|
distributed-arp-table.c | 4 +++-
|
||||||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
|
||||||
|
index 9f4cff3..be3be28 100644
|
||||||
|
--- a/distributed-arp-table.c
|
||||||
|
+++ b/distributed-arp-table.c
|
||||||
|
@@ -777,7 +777,9 @@ static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv,
|
||||||
|
ip_src = batadv_arp_ip_src(skb, hdr_size);
|
||||||
|
ip_dst = batadv_arp_ip_dst(skb, hdr_size);
|
||||||
|
if (ipv4_is_loopback(ip_src) || ipv4_is_multicast(ip_src) ||
|
||||||
|
- ipv4_is_loopback(ip_dst) || ipv4_is_multicast(ip_dst))
|
||||||
|
+ ipv4_is_loopback(ip_dst) || ipv4_is_multicast(ip_dst) ||
|
||||||
|
+ ipv4_is_zeronet(ip_src) || ipv4_is_lbcast(ip_src) ||
|
||||||
|
+ ipv4_is_zeronet(ip_dst) || ipv4_is_lbcast(ip_dst))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
type = ntohs(arphdr->ar_op);
|
||||||
|
--
|
||||||
|
1.7.10.4
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
From ab361a9ccc584e7501c06bfe1c00cb0411feebaf Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Date: Thu, 24 Jan 2013 18:18:27 +0100
|
||||||
|
Subject: [PATCH 3/3] batman-adv: filter ARP packets with invalid MAC
|
||||||
|
addresses in DAT
|
||||||
|
|
||||||
|
We never want multicast MAC addresses in the Distributed ARP Table, so it's
|
||||||
|
best to completely ignore ARP packets containing them where we expect unicast
|
||||||
|
addresses.
|
||||||
|
|
||||||
|
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Acked-by: Antonio Quartulli <ordex@autistici.org>
|
||||||
|
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||||
|
---
|
||||||
|
distributed-arp-table.c | 13 +++++++++++++
|
||||||
|
1 file changed, 13 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
|
||||||
|
index be3be28..ea0bd31 100644
|
||||||
|
--- a/distributed-arp-table.c
|
||||||
|
+++ b/distributed-arp-table.c
|
||||||
|
@@ -738,6 +738,7 @@ static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv,
|
||||||
|
struct arphdr *arphdr;
|
||||||
|
struct ethhdr *ethhdr;
|
||||||
|
__be32 ip_src, ip_dst;
|
||||||
|
+ uint8_t *hw_src, *hw_dst;
|
||||||
|
uint16_t type = 0;
|
||||||
|
|
||||||
|
/* pull the ethernet header */
|
||||||
|
@@ -782,6 +783,18 @@ static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv,
|
||||||
|
ipv4_is_zeronet(ip_dst) || ipv4_is_lbcast(ip_dst))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
+ hw_src = batadv_arp_hw_src(skb, hdr_size);
|
||||||
|
+ if (is_zero_ether_addr(hw_src) || is_multicast_ether_addr(hw_src))
|
||||||
|
+ goto out;
|
||||||
|
+
|
||||||
|
+ /* we don't care about the destination MAC address in ARP requests */
|
||||||
|
+ if (arphdr->ar_op != htons(ARPOP_REQUEST)) {
|
||||||
|
+ hw_dst = batadv_arp_hw_dst(skb, hdr_size);
|
||||||
|
+ if (is_zero_ether_addr(hw_dst) ||
|
||||||
|
+ is_multicast_ether_addr(hw_dst))
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
type = ntohs(arphdr->ar_op);
|
||||||
|
out:
|
||||||
|
return type;
|
||||||
|
--
|
||||||
|
1.7.10.4
|
||||||
|
|
Loading…
Reference in New Issue