Merge pull request #656 from ecsv/batadv-2021.1
batman-adv: update packages to version 2021.1
This commit is contained in:
commit
6cd369d1aa
12 changed files with 204 additions and 316 deletions
|
@ -3,12 +3,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alfred
|
||||
PKG_VERSION:=2021.0
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=2021.1
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
|
||||
PKG_HASH:=a062c08da21e0a23ae0554d392c8147dfd2129ae6975a7f5004dc680fee2244b
|
||||
PKG_HASH:=94e2cf4dad885f9059fc8b8694a71eca51c9e184683bb99a79e3de8cb7485e88
|
||||
|
||||
PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
|
||||
PKG_LICENSE:=GPL-2.0-only MIT
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Mon, 15 Feb 2021 19:56:22 +0100
|
||||
Subject: alfred: Show error message for invalid batadv interface
|
||||
|
||||
The alfred server process always stopped without any informational message
|
||||
when the provided batman-adv was not "none" and was not accessible. This
|
||||
made it extremely hard to debug the reason why alfred directly stopped
|
||||
after launching it.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-1-sven@narfation.org/
|
||||
|
||||
diff --git a/server.c b/server.c
|
||||
index fc27246b845af75bd1f459f8bb553aef87cc24d5..efac5ad399df52f8c444711a14bcf4814e38a3bf 100644
|
||||
--- a/server.c
|
||||
+++ b/server.c
|
||||
@@ -385,8 +385,11 @@ int alfred_server(struct globals *globals)
|
||||
}
|
||||
|
||||
if (strcmp(globals->mesh_iface, "none") != 0 &&
|
||||
- batadv_interface_check(globals->mesh_iface) < 0)
|
||||
+ batadv_interface_check(globals->mesh_iface) < 0) {
|
||||
+ fprintf(stderr, "Can't start server: batman-adv interface %s not found\n",
|
||||
+ globals->mesh_iface);
|
||||
return -1;
|
||||
+ }
|
||||
|
||||
num_socks = netsock_open_all(globals);
|
||||
if (num_socks <= 0) {
|
|
@ -1,72 +0,0 @@
|
|||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Mon, 15 Feb 2021 20:16:15 +0100
|
||||
Subject: alfred: Allow exactly one interface for secondary mode
|
||||
|
||||
A primary alfred daemon allows syncing over more than one interface. But
|
||||
the secondary alfred daemon needs exactly one interface. But the check for
|
||||
this property was insufficient because it allowed paramters like
|
||||
"-i wlan0,asd" when wlan0 is valid and asd is not valid.
|
||||
|
||||
The better solution is to really use the number of interfaces given to
|
||||
alfred instead of the number of interfaces evaluated as "valid".
|
||||
|
||||
Fixes: 67ae5f57eedd ("alfred: Add support for multiple interfaces per master")
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-2-sven@narfation.org/
|
||||
|
||||
diff --git a/alfred.h b/alfred.h
|
||||
index 1e2c05835cbfba02ebabefe55afc29f7ef8e12b1..7d6b0b35b5c8b8c3b087589880c390eb035584be 100644
|
||||
--- a/alfred.h
|
||||
+++ b/alfred.h
|
||||
@@ -182,6 +182,7 @@ int unix_sock_req_data_finish(struct globals *globals,
|
||||
int vis_update_data(struct globals *globals);
|
||||
/* netsock.c */
|
||||
int netsock_open_all(struct globals *globals);
|
||||
+size_t netsocket_count_interfaces(struct globals *globals);
|
||||
void netsock_close_all(struct globals *globals);
|
||||
int netsock_set_interfaces(struct globals *globals, char *interfaces);
|
||||
struct interface *netsock_first_interface(struct globals *globals);
|
||||
diff --git a/netsock.c b/netsock.c
|
||||
index 367b20730500a1c24448200a24149b64059f3381..84b0ec3827e491eead997f58b2b8f26c5b18b843 100644
|
||||
--- a/netsock.c
|
||||
+++ b/netsock.c
|
||||
@@ -471,6 +471,17 @@ int netsock_open_all(struct globals *globals)
|
||||
return num_socks;
|
||||
}
|
||||
|
||||
+size_t netsocket_count_interfaces(struct globals *globals)
|
||||
+{
|
||||
+ struct interface *interface;
|
||||
+ size_t count = 0;
|
||||
+
|
||||
+ list_for_each_entry(interface, &globals->interfaces, list)
|
||||
+ count++;
|
||||
+
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
void netsock_reopen(struct globals *globals)
|
||||
{
|
||||
struct interface *interface;
|
||||
diff --git a/server.c b/server.c
|
||||
index efac5ad399df52f8c444711a14bcf4814e38a3bf..eb2bc8aeb787e4bf028c8f9e3a523a18c6992be1 100644
|
||||
--- a/server.c
|
||||
+++ b/server.c
|
||||
@@ -371,6 +371,7 @@ int alfred_server(struct globals *globals)
|
||||
int maxsock, ret, recvs;
|
||||
struct timespec last_check, now, tv;
|
||||
fd_set fds, errfds;
|
||||
+ size_t num_interfaces;
|
||||
int num_socks;
|
||||
|
||||
if (create_hashes(globals))
|
||||
@@ -397,7 +398,8 @@ int alfred_server(struct globals *globals)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (num_socks > 1 && globals->opmode == OPMODE_SECONDARY) {
|
||||
+ num_interfaces = netsocket_count_interfaces(globals);
|
||||
+ if (num_interfaces > 1 && globals->opmode == OPMODE_SECONDARY) {
|
||||
fprintf(stderr, "More than one interface specified in secondary mode\n");
|
||||
return -1;
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Mon, 15 Feb 2021 20:34:54 +0100
|
||||
Subject: alfred: Save global mode flags in bitfield
|
||||
|
||||
The verbose and ipv4mode entries in the globals structure is only used to
|
||||
save a boolean information. So just use a bit in a bitfield to store this
|
||||
information instead of a full int.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-3-sven@narfation.org/
|
||||
|
||||
diff --git a/alfred.h b/alfred.h
|
||||
index 7d6b0b35b5c8b8c3b087589880c390eb035584be..c64ff17ab9be8a16b3e1c86070b93235c226a004 100644
|
||||
--- a/alfred.h
|
||||
+++ b/alfred.h
|
||||
@@ -115,8 +115,8 @@ struct globals {
|
||||
enum clientmode clientmode;
|
||||
int clientmode_arg;
|
||||
int clientmode_version;
|
||||
- int verbose;
|
||||
- int ipv4mode;
|
||||
+ uint8_t verbose:1;
|
||||
+ uint8_t ipv4mode:1;
|
||||
|
||||
int unix_sock;
|
||||
const char *unix_path;
|
||||
diff --git a/main.c b/main.c
|
||||
index 7b866cc4275797beb7f614dd1a19ea0099e1281b..f25b6cc11975b8523abf6c59b77a86e94684b03b 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
+#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -181,8 +182,8 @@ static struct globals *alfred_init(int argc, char *argv[])
|
||||
globals->clientmode_version = 0;
|
||||
globals->mesh_iface = "bat0";
|
||||
globals->unix_path = ALFRED_SOCK_PATH_DEFAULT;
|
||||
- globals->verbose = 0;
|
||||
- globals->ipv4mode = 0;
|
||||
+ globals->verbose = false;
|
||||
+ globals->ipv4mode = false;
|
||||
globals->update_command = NULL;
|
||||
globals->sync_period.tv_sec = ALFRED_INTERVAL;
|
||||
globals->sync_period.tv_nsec = 0;
|
||||
@@ -252,7 +253,7 @@ static struct globals *alfred_init(int argc, char *argv[])
|
||||
globals->unix_path = optarg;
|
||||
break;
|
||||
case 'd':
|
||||
- globals->verbose++;
|
||||
+ globals->verbose = true;
|
||||
break;
|
||||
case 'c':
|
||||
globals->update_command = optarg;
|
||||
@@ -268,7 +269,7 @@ static struct globals *alfred_init(int argc, char *argv[])
|
||||
printf(" ** Setting sync interval to: %.9f seconds (%ld.%09ld)\n", sync_period, globals->sync_period.tv_sec, globals->sync_period.tv_nsec);
|
||||
break;
|
||||
case '4':
|
||||
- globals->ipv4mode = 1;
|
||||
+ globals->ipv4mode = true;
|
||||
inet_pton(AF_INET, optarg, &alfred_mcast.ipv4);
|
||||
printf(" ** IPv4 Multicast Mode: %x\n", alfred_mcast.ipv4.s_addr);
|
||||
break;
|
|
@ -1,102 +0,0 @@
|
|||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Mon, 15 Feb 2021 20:52:17 +0100
|
||||
Subject: alfred: Allow start of server without valid interface
|
||||
|
||||
The alfred server always needs interfaces to operate on. But these
|
||||
interfaces might not exist at the moment when the daemon process is
|
||||
started. This caused an error and stopped the process.
|
||||
|
||||
But alfred is able to deal with interfaces which disappeared at runtime but
|
||||
existed at startup. To force a similar behavior for the alfred startup, the
|
||||
parameter "--force" or "-f" is introduced.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Forwarded: https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20210215200126.140253-4-sven@narfation.org/
|
||||
|
||||
diff --git a/alfred.h b/alfred.h
|
||||
index c64ff17ab9be8a16b3e1c86070b93235c226a004..ac082536bd6565756835489194be9b80fe0dd653 100644
|
||||
--- a/alfred.h
|
||||
+++ b/alfred.h
|
||||
@@ -117,6 +117,7 @@ struct globals {
|
||||
int clientmode_version;
|
||||
uint8_t verbose:1;
|
||||
uint8_t ipv4mode:1;
|
||||
+ uint8_t force:1;
|
||||
|
||||
int unix_sock;
|
||||
const char *unix_path;
|
||||
diff --git a/main.c b/main.c
|
||||
index f25b6cc11975b8523abf6c59b77a86e94684b03b..e190d4274a0fe2abdb2c462a5bdefb3e199d4797 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -164,6 +164,7 @@ static struct globals *alfred_init(int argc, char *argv[])
|
||||
{"version", no_argument, NULL, 'v'},
|
||||
{"verbose", no_argument, NULL, 'd'},
|
||||
{"sync-period", required_argument, NULL, 'p'},
|
||||
+ {"force", no_argument, NULL, 'f'},
|
||||
{NULL, 0, NULL, 0},
|
||||
};
|
||||
|
||||
@@ -184,6 +185,7 @@ static struct globals *alfred_init(int argc, char *argv[])
|
||||
globals->unix_path = ALFRED_SOCK_PATH_DEFAULT;
|
||||
globals->verbose = false;
|
||||
globals->ipv4mode = false;
|
||||
+ globals->force = false;
|
||||
globals->update_command = NULL;
|
||||
globals->sync_period.tv_sec = ALFRED_INTERVAL;
|
||||
globals->sync_period.tv_nsec = 0;
|
||||
@@ -191,7 +193,7 @@ static struct globals *alfred_init(int argc, char *argv[])
|
||||
|
||||
time_random_seed();
|
||||
|
||||
- while ((opt = getopt_long(argc, argv, "ms:r:hi:b:vV:M:I:u:dc:p:4:", long_options,
|
||||
+ while ((opt = getopt_long(argc, argv, "ms:r:hi:b:vV:M:I:u:dc:p:4:f", long_options,
|
||||
&opt_ind)) != -1) {
|
||||
switch (opt) {
|
||||
case 'r':
|
||||
@@ -273,6 +275,9 @@ static struct globals *alfred_init(int argc, char *argv[])
|
||||
inet_pton(AF_INET, optarg, &alfred_mcast.ipv4);
|
||||
printf(" ** IPv4 Multicast Mode: %x\n", alfred_mcast.ipv4.s_addr);
|
||||
break;
|
||||
+ case 'f':
|
||||
+ globals->force = true;
|
||||
+ break;
|
||||
case 'h':
|
||||
default:
|
||||
alfred_usage();
|
||||
diff --git a/man/alfred.8 b/man/alfred.8
|
||||
index 25591be9ece1f8de572be8f639576861e318005f..e965db8260086cc83bc78ad95f97bc368a6cb170 100644
|
||||
--- a/man/alfred.8
|
||||
+++ b/man/alfred.8
|
||||
@@ -72,6 +72,9 @@ Collect data from the network and prints it on the network
|
||||
\fB\-d\fP, \fB\-\-verbose\fP
|
||||
Show extra information in the data output
|
||||
.TP
|
||||
+\fB\-d\fP, \fB\-\-force\fP
|
||||
+Start server even when batman-adv or interface(s) are not yet available.
|
||||
+.TP
|
||||
\fB\-V\fP, \fB\-\-req\-version\fP \fIversion\fP
|
||||
Specify the data version set for \fB\-s\fP
|
||||
|
||||
diff --git a/server.c b/server.c
|
||||
index eb2bc8aeb787e4bf028c8f9e3a523a18c6992be1..b4925e7e16ba7465662a5dbf12432916fed8bd03 100644
|
||||
--- a/server.c
|
||||
+++ b/server.c
|
||||
@@ -386,14 +386,15 @@ int alfred_server(struct globals *globals)
|
||||
}
|
||||
|
||||
if (strcmp(globals->mesh_iface, "none") != 0 &&
|
||||
- batadv_interface_check(globals->mesh_iface) < 0) {
|
||||
+ batadv_interface_check(globals->mesh_iface) < 0 &&
|
||||
+ !globals->force) {
|
||||
fprintf(stderr, "Can't start server: batman-adv interface %s not found\n",
|
||||
globals->mesh_iface);
|
||||
return -1;
|
||||
}
|
||||
|
||||
num_socks = netsock_open_all(globals);
|
||||
- if (num_socks <= 0) {
|
||||
+ if (num_socks <= 0 && !globals->force) {
|
||||
fprintf(stderr, "Failed to open interfaces\n");
|
||||
return -1;
|
||||
}
|
|
@ -3,12 +3,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=batctl
|
||||
PKG_VERSION:=2021.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=2021.1
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
|
||||
PKG_HASH:=9cec8bf1952f885192749a9dc0318a54633b717aaf05c438d504efd83f5201e4
|
||||
PKG_HASH:=44b28cebb46b8ba1bc170bedeef67f69d89503806c429ff8cb113cc01966e176
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
|
||||
|
@ -95,27 +95,37 @@ config-n := \
|
|||
backbonetable \
|
||||
bisect_iv \
|
||||
bonding \
|
||||
bla_backbone_json \
|
||||
bla_claim_json \
|
||||
bridge_loop_avoidance \
|
||||
claimtable \
|
||||
dat_cache \
|
||||
dat_cache_json \
|
||||
distributed_arp_table \
|
||||
elp_interval \
|
||||
event \
|
||||
fragmentation \
|
||||
gateways \
|
||||
gateways_json \
|
||||
gw_mode \
|
||||
hardif_json \
|
||||
hardifs_json \
|
||||
hop_penalty \
|
||||
interface \
|
||||
isolation_mark \
|
||||
loglevel \
|
||||
mcast_flags \
|
||||
mcast_flags_json \
|
||||
mesh_json \
|
||||
multicast_fanout \
|
||||
multicast_forceflood \
|
||||
multicast_mode \
|
||||
neighbors \
|
||||
neighbors_json \
|
||||
network_coding \
|
||||
orig_interval \
|
||||
originators \
|
||||
originators_json \
|
||||
ping \
|
||||
routing_algo \
|
||||
statistics \
|
||||
|
@ -126,6 +136,9 @@ config-n := \
|
|||
transglobal \
|
||||
translate \
|
||||
translocal \
|
||||
transtable_global_json \
|
||||
transtable_local_json \
|
||||
vlan_json \
|
||||
|
||||
config-settings := \
|
||||
aggregation \
|
||||
|
@ -160,6 +173,21 @@ config-tables := \
|
|||
transglobal \
|
||||
translocal \
|
||||
|
||||
config-json := \
|
||||
bla_backbone_json \
|
||||
bla_claim_json \
|
||||
dat_cache_json \
|
||||
gateways_json \
|
||||
hardif_json \
|
||||
hardifs_json \
|
||||
mcast_flags_json \
|
||||
mesh_json \
|
||||
neighbors_json \
|
||||
originators_json \
|
||||
transtable_global_json \
|
||||
transtable_local_json \
|
||||
vlan_json \
|
||||
|
||||
config-tools := \
|
||||
event \
|
||||
ping \
|
||||
|
@ -183,6 +211,7 @@ ifeq ($(BUILD_VARIANT),default)
|
|||
config-y := \
|
||||
$(config-settings) \
|
||||
$(config-tables) \
|
||||
$(config-json) \
|
||||
$(config-tools) \
|
||||
|
||||
endif
|
||||
|
@ -192,6 +221,7 @@ ifeq ($(BUILD_VARIANT),full)
|
|||
config-y := \
|
||||
$(config-settings) \
|
||||
$(config-tables) \
|
||||
$(config-json) \
|
||||
$(config-tools) \
|
||||
$(config-extratools) \
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Thu, 28 Jan 2021 20:44:22 +0100
|
||||
Subject: batctl: Fix build of routing_algo against musl
|
||||
|
||||
glibc is including the headers for the rtnetlink functionality. But musl
|
||||
avoids this indirect include. The headers must therefore be included
|
||||
explicitely.
|
||||
|
||||
Fixes: e0ccb9b575d9 ("batctl: Switch active routing algo list to netlink")
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Origin: upstream, https://git.open-mesh.org/batctl.git/commit/b0044a6b2f8a762387d9b7408b1fe528f21c4ad7
|
||||
|
||||
diff --git a/routing_algo.c b/routing_algo.c
|
||||
index 27458ffdd9b91decbecbe6ec5da8ffd14c863a35..b5e3ebb8c5a4743cd2c42634d79f8a4c6a8210db 100644
|
||||
--- a/routing_algo.c
|
||||
+++ b/routing_algo.c
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
+#include <linux/if_link.h>
|
||||
+#include <linux/rtnetlink.h>
|
||||
#include <netinet/if_ether.h>
|
||||
#include <netlink/netlink.h>
|
||||
#include <netlink/genl/genl.h>
|
|
@ -3,12 +3,12 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=batman-adv
|
||||
PKG_VERSION:=2021.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=2021.1
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
|
||||
PKG_HASH:=5a989ba580897268373bd516b87b588061f344af773a0f6b038a3d8d2af028a1
|
||||
PKG_HASH:=bf77843d8dead75342d673ce7021e4ad037447ce18c64056ae1e3202039934d0
|
||||
PKG_EXTMOD_SUBDIRS:=net/batman-adv
|
||||
|
||||
PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
|
||||
|
|
|
@ -13,7 +13,7 @@ or newer - otherwise it will not work as expected.
|
|||
This reverts commit 725b4ef5be840cfcd0ca33b9393c14dee40c10f7.
|
||||
|
||||
diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h
|
||||
index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533bee89a67 100644
|
||||
index 56a9ab22c062b1d0d01ef9d09ce796075d3d6df7..8f542bef10dc0f2682ab2d428c90df9ab97977ce 100644
|
||||
--- a/compat-include/net/genetlink.h
|
||||
+++ b/compat-include/net/genetlink.h
|
||||
@@ -31,17 +31,15 @@ void batadv_genl_dump_check_consistent(struct netlink_callback *cb,
|
||||
|
@ -107,7 +107,7 @@ index f16355febac42294491531a3f8049bc680560d0c..d1f80cd88503cdd11e9051f2e90ea533
|
|||
|
||||
#endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */
|
||||
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
|
||||
index 97bcf149633d850ff4fcece6d7dc0d799adb1444..a8f15c04826af1144db655887b754758fc5ab47a 100644
|
||||
index f317d206b411d87b4da2f57e35c3fb78cedfb160..bdac5dbd899a9540d58052fd32c8c89520927390 100644
|
||||
--- a/net/batman-adv/netlink.c
|
||||
+++ b/net/batman-adv/netlink.c
|
||||
@@ -1351,7 +1351,7 @@ static void batadv_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
|
||||
|
|
|
@ -11,12 +11,12 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
|||
|
||||
diff --git a/compat-include/linux/minmax.h b/compat-include/linux/minmax.h
|
||||
deleted file mode 100644
|
||||
index 4b19479bc5ea12c5005485f623decfad90a85cff..0000000000000000000000000000000000000000
|
||||
index 9b7269e8a760361c1650b947c77702f0bdcd73d9..0000000000000000000000000000000000000000
|
||||
--- a/compat-include/linux/minmax.h
|
||||
+++ /dev/null
|
||||
@@ -1,20 +0,0 @@
|
||||
-/* SPDX-License-Identifier: GPL-2.0 */
|
||||
-/* Copyright (C) 2007-2020 B.A.T.M.A.N. contributors:
|
||||
-/* Copyright (C) B.A.T.M.A.N. contributors:
|
||||
- *
|
||||
- * Marek Lindner, Simon Wunderlich
|
||||
- *
|
||||
|
@ -36,7 +36,7 @@ index 4b19479bc5ea12c5005485f623decfad90a85cff..00000000000000000000000000000000
|
|||
-
|
||||
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_MINMAX_H_ */
|
||||
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
|
||||
index e4455babe4c28f8c1527a17e825675183c37ea1d..22183e954647089ca72a941e744375d72e1f94b0 100644
|
||||
index e1ca2b8c315235f234c9061fc73cde2c1b76aa46..eeb3f6d00d8541b377c9703837ef76b05e8d061e 100644
|
||||
--- a/net/batman-adv/bat_v.c
|
||||
+++ b/net/batman-adv/bat_v.c
|
||||
@@ -15,7 +15,6 @@
|
||||
|
@ -48,7 +48,7 @@ index e4455babe4c28f8c1527a17e825675183c37ea1d..22183e954647089ca72a941e744375d7
|
|||
#include <linux/netlink.h>
|
||||
#include <linux/rculist.h>
|
||||
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
|
||||
index 0512ea6cd818c22768e601f446ff806cf863163b..79a7dfc32e76c511c5b5d8716cbebf64f6228d9d 100644
|
||||
index 423c2d17170387bfe89b83c4e20f06d525a36b30..4d8e3fdb4427a431cab903bc8a20edb816079fd7 100644
|
||||
--- a/net/batman-adv/bat_v_elp.c
|
||||
+++ b/net/batman-adv/bat_v_elp.c
|
||||
@@ -18,7 +18,6 @@
|
||||
|
@ -60,7 +60,7 @@ index 0512ea6cd818c22768e601f446ff806cf863163b..79a7dfc32e76c511c5b5d8716cbebf64
|
|||
#include <linux/nl80211.h>
|
||||
#include <linux/prandom.h>
|
||||
diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c
|
||||
index 798d659855d0bcc9d7638901fedeb77d830f1980..8c1148fc73d776c076bdb35896f5536d7378578d 100644
|
||||
index a0a9636d17406362f879f342300a18e75424efa5..89ba88322c9c11acc49a9dcd9877ad8767fe713b 100644
|
||||
--- a/net/batman-adv/bat_v_ogm.c
|
||||
+++ b/net/batman-adv/bat_v_ogm.c
|
||||
@@ -18,7 +18,6 @@
|
||||
|
@ -72,7 +72,7 @@ index 798d659855d0bcc9d7638901fedeb77d830f1980..8c1148fc73d776c076bdb35896f5536d
|
|||
#include <linux/netdevice.h>
|
||||
#include <linux/prandom.h>
|
||||
diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
|
||||
index e522f1fcfd9af04ee2d92b1b11ace6960d6f9c9f..ea40e54867573320d44e68524589454db553fb81 100644
|
||||
index a5d9d800082bade3a1d52cc040557e41f963fac3..96873d47fac5cb9b4fbfa217eedf1f92818b0e98 100644
|
||||
--- a/net/batman-adv/fragmentation.c
|
||||
+++ b/net/batman-adv/fragmentation.c
|
||||
@@ -14,8 +14,8 @@
|
||||
|
@ -86,7 +86,7 @@ index e522f1fcfd9af04ee2d92b1b11ace6960d6f9c9f..ea40e54867573320d44e68524589454d
|
|||
#include <linux/skbuff.h>
|
||||
#include <linux/slab.h>
|
||||
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
|
||||
index 0f186ddc15e30a9c9f5e4de44b96b2c7b27d8b86..b57e95c959cf064a74a01d25a24bdc495caa6324 100644
|
||||
index 4a6a25d551a83b1723e80a349e1a655a2152b0ac..eabde547d308438257622879e77d84c24daa2199 100644
|
||||
--- a/net/batman-adv/hard-interface.c
|
||||
+++ b/net/batman-adv/hard-interface.c
|
||||
@@ -18,7 +18,6 @@
|
||||
|
@ -98,7 +98,7 @@ index 0f186ddc15e30a9c9f5e4de44b96b2c7b27d8b86..b57e95c959cf064a74a01d25a24bdc49
|
|||
#include <linux/netdevice.h>
|
||||
#include <linux/printk.h>
|
||||
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
|
||||
index ed9d87ce3407614e5e37922fe3039324adb027cc..edc0d53e9ba0a79ad0c37986e15ec362fb009f4f 100644
|
||||
index 3ddd66e4c29ef532de33c7182cc0cc470b33fd4f..c552bc4168d0abd7bf6d23e570d583806fb162b1 100644
|
||||
--- a/net/batman-adv/main.c
|
||||
+++ b/net/batman-adv/main.c
|
||||
@@ -23,7 +23,6 @@
|
||||
|
@ -110,7 +110,7 @@ index ed9d87ce3407614e5e37922fe3039324adb027cc..edc0d53e9ba0a79ad0c37986e15ec362
|
|||
#include <linux/netdevice.h>
|
||||
#include <linux/printk.h>
|
||||
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
|
||||
index a8f15c04826af1144db655887b754758fc5ab47a..dc193618a761c0b451e860ca83921007d286e09b 100644
|
||||
index bdac5dbd899a9540d58052fd32c8c89520927390..b6a703ddd8e97e6a02e8d73c5728802f090ab419 100644
|
||||
--- a/net/batman-adv/netlink.c
|
||||
+++ b/net/batman-adv/netlink.c
|
||||
@@ -23,7 +23,6 @@
|
||||
|
@ -122,7 +122,7 @@ index a8f15c04826af1144db655887b754758fc5ab47a..dc193618a761c0b451e860ca83921007
|
|||
#include <linux/netlink.h>
|
||||
#include <linux/printk.h>
|
||||
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
|
||||
index d4e10005df6cd2936a3132e1ad7bd8bf3c1d99b6..db7e3774825b5f5871b23c0e4fa5ce7afb2accd6 100644
|
||||
index 789c851732b78ad9d1515f7b171219cc770c7045..46b774c08c947def8f72f260224254b01c3a387d 100644
|
||||
--- a/net/batman-adv/tp_meter.c
|
||||
+++ b/net/batman-adv/tp_meter.c
|
||||
@@ -23,7 +23,6 @@
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Fri, 14 May 2021 19:34:35 +0200
|
||||
Subject: batman-adv: Fix build of multicast code against Linux < 5.13
|
||||
|
||||
Fixes: 007b4c4b031f ("batman-adv: convert ifmcaddr6 to RCU")
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
|
||||
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
|
||||
index 1d63c8cbbfe7b16e360e91bcf3bb77ec7b12893b..ece9fb5dd81bfadbdbe15363dfd8fd257dbe942f 100644
|
||||
--- a/net/batman-adv/multicast.c
|
||||
+++ b/net/batman-adv/multicast.c
|
||||
@@ -454,9 +454,14 @@ batadv_mcast_mla_softif_get_ipv6(struct net_device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_IS_LESS(5, 13, 0)
|
||||
+ read_lock_bh(&in6_dev->lock);
|
||||
+ for (pmc6 = in6_dev->mc_list; pmc6; pmc6 = pmc6->next) {
|
||||
+#else
|
||||
for (pmc6 = rcu_dereference(in6_dev->mc_list);
|
||||
pmc6;
|
||||
pmc6 = rcu_dereference(pmc6->next)) {
|
||||
+#endif
|
||||
if (IPV6_ADDR_MC_SCOPE(&pmc6->mca_addr) <
|
||||
IPV6_ADDR_SCOPE_LINKLOCAL)
|
||||
continue;
|
||||
@@ -485,6 +490,9 @@ batadv_mcast_mla_softif_get_ipv6(struct net_device *dev,
|
||||
hlist_add_head(&new->list, mcast_list);
|
||||
ret++;
|
||||
}
|
||||
+#if LINUX_VERSION_IS_LESS(5, 13, 0)
|
||||
+ read_unlock_bh(&in6_dev->lock);
|
||||
+#endif
|
||||
rcu_read_unlock();
|
||||
|
||||
return ret;
|
|
@ -0,0 +1,117 @@
|
|||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Mon, 10 May 2021 15:05:42 +0200
|
||||
Subject: batman-adv: Always send iface index+name in genlmsg
|
||||
|
||||
The batman-adv netlink messages often contain the interface index and
|
||||
interface name in the same message. This makes it easy for the receiver to
|
||||
operate on the incoming data when it either needs to print something or
|
||||
needs to operate on the interface index.
|
||||
|
||||
But one of the attributes was missing for:
|
||||
|
||||
* neighbor table dumps
|
||||
* originator table dumps
|
||||
* gateway list dumps
|
||||
* query of hardif information
|
||||
* query of vid information
|
||||
|
||||
The userspace therefore had to implement special workarounds using
|
||||
SIOCGIFNAME or SIOCGIFINDEX depending on what was actually provided.
|
||||
Providing both information simplifies the userspace code massively without
|
||||
adding a lot of extra overhead in the kernel portion.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/77c7d62618259f22f36427eaa62668e6e1c43090
|
||||
|
||||
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
|
||||
index 789f257be24f36ace3e63628a3381a6d46dcccd9..680def809838097a9949de1dc9861923911f3d04 100644
|
||||
--- a/net/batman-adv/bat_iv_ogm.c
|
||||
+++ b/net/batman-adv/bat_iv_ogm.c
|
||||
@@ -1849,6 +1849,8 @@ batadv_iv_ogm_orig_dump_subentry(struct sk_buff *msg, u32 portid, u32 seq,
|
||||
orig_node->orig) ||
|
||||
nla_put(msg, BATADV_ATTR_NEIGH_ADDRESS, ETH_ALEN,
|
||||
neigh_node->addr) ||
|
||||
+ nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
|
||||
+ neigh_node->if_incoming->net_dev->name) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
|
||||
neigh_node->if_incoming->net_dev->ifindex) ||
|
||||
nla_put_u8(msg, BATADV_ATTR_TQ, tq_avg) ||
|
||||
@@ -2078,6 +2080,8 @@ batadv_iv_ogm_neigh_dump_neigh(struct sk_buff *msg, u32 portid, u32 seq,
|
||||
|
||||
if (nla_put(msg, BATADV_ATTR_NEIGH_ADDRESS, ETH_ALEN,
|
||||
hardif_neigh->addr) ||
|
||||
+ nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
|
||||
+ hardif_neigh->if_incoming->net_dev->name) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
|
||||
hardif_neigh->if_incoming->net_dev->ifindex) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_LAST_SEEN_MSECS,
|
||||
@@ -2459,6 +2463,8 @@ static int batadv_iv_gw_dump_entry(struct sk_buff *msg, u32 portid,
|
||||
router->addr) ||
|
||||
nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
|
||||
router->if_incoming->net_dev->name) ||
|
||||
+ nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
|
||||
+ router->if_incoming->net_dev->ifindex) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_BANDWIDTH_DOWN,
|
||||
gw_node->bandwidth_down) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_BANDWIDTH_UP,
|
||||
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
|
||||
index eeb3f6d00d8541b377c9703837ef76b05e8d061e..fd7f30f5f3033fd1a9e21518a71e66b557212374 100644
|
||||
--- a/net/batman-adv/bat_v.c
|
||||
+++ b/net/batman-adv/bat_v.c
|
||||
@@ -145,6 +145,8 @@ batadv_v_neigh_dump_neigh(struct sk_buff *msg, u32 portid, u32 seq,
|
||||
|
||||
if (nla_put(msg, BATADV_ATTR_NEIGH_ADDRESS, ETH_ALEN,
|
||||
hardif_neigh->addr) ||
|
||||
+ nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
|
||||
+ hardif_neigh->if_incoming->net_dev->name) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
|
||||
hardif_neigh->if_incoming->net_dev->ifindex) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_LAST_SEEN_MSECS,
|
||||
@@ -297,6 +299,8 @@ batadv_v_orig_dump_subentry(struct sk_buff *msg, u32 portid, u32 seq,
|
||||
if (nla_put(msg, BATADV_ATTR_ORIG_ADDRESS, ETH_ALEN, orig_node->orig) ||
|
||||
nla_put(msg, BATADV_ATTR_NEIGH_ADDRESS, ETH_ALEN,
|
||||
neigh_node->addr) ||
|
||||
+ nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
|
||||
+ neigh_node->if_incoming->net_dev->name) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
|
||||
neigh_node->if_incoming->net_dev->ifindex) ||
|
||||
nla_put_u32(msg, BATADV_ATTR_THROUGHPUT, throughput) ||
|
||||
@@ -738,6 +742,12 @@ static int batadv_v_gw_dump_entry(struct sk_buff *msg, u32 portid,
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ if (nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
|
||||
+ router->if_incoming->net_dev->ifindex)) {
|
||||
+ genlmsg_cancel(msg, hdr);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
if (nla_put_u32(msg, BATADV_ATTR_BANDWIDTH_DOWN,
|
||||
gw_node->bandwidth_down)) {
|
||||
genlmsg_cancel(msg, hdr);
|
||||
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
|
||||
index b6a703ddd8e97e6a02e8d73c5728802f090ab419..27f78f0c4aea025b964301e20f972031ab8ad478 100644
|
||||
--- a/net/batman-adv/netlink.c
|
||||
+++ b/net/batman-adv/netlink.c
|
||||
@@ -813,6 +813,10 @@ static int batadv_netlink_hardif_fill(struct sk_buff *msg,
|
||||
bat_priv->soft_iface->ifindex))
|
||||
goto nla_put_failure;
|
||||
|
||||
+ if (nla_put_string(msg, BATADV_ATTR_MESH_IFNAME,
|
||||
+ bat_priv->soft_iface->name))
|
||||
+ goto nla_put_failure;
|
||||
+
|
||||
if (nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
|
||||
net_dev->ifindex) ||
|
||||
nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
|
||||
@@ -1044,6 +1048,10 @@ static int batadv_netlink_vlan_fill(struct sk_buff *msg,
|
||||
bat_priv->soft_iface->ifindex))
|
||||
goto nla_put_failure;
|
||||
|
||||
+ if (nla_put_string(msg, BATADV_ATTR_MESH_IFNAME,
|
||||
+ bat_priv->soft_iface->name))
|
||||
+ goto nla_put_failure;
|
||||
+
|
||||
if (nla_put_u32(msg, BATADV_ATTR_VLANID, vlan->vid & VLAN_VID_MASK))
|
||||
goto nla_put_failure;
|
||||
|
Loading…
Reference in a new issue