Skip to content

Commit 59372af

Browse files
committed
Merge tag 'batadv-next-pullrequest-20250117' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - Reorder includes for distributed-arp-table.c, by Sven Eckelmann - Fix translation table change handling, by Remi Pommarel (2 patches) - Map VID 0 to untagged TT VLAN, by Sven Eckelmann - Update MAINTAINERS/mailmap e-mail addresses, by the respective authors (4 patches) - netlink: reduce duplicate code by returning interfaces, by Linus Lüssing * tag 'batadv-next-pullrequest-20250117' of git://git.open-mesh.org/linux-merge: batman-adv: netlink: reduce duplicate code by returning interfaces MAINTAINERS: mailmap: add entries for Antonio Quartulli mailmap: add entries for Sven Eckelmann mailmap: add entries for Simon Wunderlich MAINTAINERS: update email address of Marek Linder batman-adv: Map VID 0 to untagged TT VLAN batman-adv: Don't keep redundant TT change events batman-adv: Remove atomic usage for tt.local_changes batman-adv: Reorder includes for distributed-arp-table.c batman-adv: Start new development cycle ==================== Link: https://patch.msgid.link/20250117123910.219278-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 1a280c5 + 6ecc4fd commit 59372af

15 files changed

Lines changed: 251 additions & 252 deletions

.mailmap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ Anirudh Ghayal <quic_aghayal@quicinc.com> <aghayal@codeaurora.org>
8383
Antoine Tenart <atenart@kernel.org> <antoine.tenart@bootlin.com>
8484
Antoine Tenart <atenart@kernel.org> <antoine.tenart@free-electrons.com>
8585
Antonio Ospite <ao2@ao2.it> <ao2@amarulasolutions.com>
86+
Antonio Quartulli <antonio@mandelbit.com> <antonio@meshcoding.com>
87+
Antonio Quartulli <antonio@mandelbit.com> <antonio@open-mesh.com>
88+
Antonio Quartulli <antonio@mandelbit.com> <antonio.quartulli@open-mesh.com>
89+
Antonio Quartulli <antonio@mandelbit.com> <ordex@autistici.org>
90+
Antonio Quartulli <antonio@mandelbit.com> <ordex@ritirata.org>
91+
Antonio Quartulli <antonio@mandelbit.com> <antonio@openvpn.net>
92+
Antonio Quartulli <antonio@mandelbit.com> <a@unstable.cc>
8693
Anup Patel <anup@brainfault.org> <anup.patel@wdc.com>
8794
Archit Taneja <archit@ti.com>
8895
Ard Biesheuvel <ardb@kernel.org> <ard.biesheuvel@linaro.org>
@@ -429,6 +436,8 @@ Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com>
429436
Marc Zyngier <maz@kernel.org> <marc.zyngier@arm.com>
430437
Marek Behún <kabel@kernel.org> <marek.behun@nic.cz>
431438
Marek Behún <kabel@kernel.org> Marek Behun <marek.behun@nic.cz>
439+
Marek Lindner <marek.lindner@mailbox.org> <lindner_marek@yahoo.de>
440+
Marek Lindner <marek.lindner@mailbox.org> <mareklindner@neomailbox.ch>
432441
Mark Brown <broonie@sirena.org.uk>
433442
Mark Starovoytov <mstarovo@pm.me> <mstarovoitov@marvell.com>
434443
Markus Schneider-Pargmann <msp@baylibre.com> <mpa@pengutronix.de>
@@ -644,6 +653,11 @@ Simona Vetter <simona.vetter@ffwll.ch> <daniel@biene.ffwll.ch>
644653
Simon Horman <horms@kernel.org> <simon.horman@corigine.com>
645654
Simon Horman <horms@kernel.org> <simon.horman@netronome.com>
646655
Simon Kelley <simon@thekelleys.org.uk>
656+
Simon Wunderlich <sw@simonwunderlich.de> <simon.wunderlich@open-mesh.com>
657+
Simon Wunderlich <sw@simonwunderlich.de> <simon.wunderlich@s2003.tu-chemnitz.de>
658+
Simon Wunderlich <sw@simonwunderlich.de> <simon.wunderlich@saxnet.de>
659+
Simon Wunderlich <sw@simonwunderlich.de> <simon@open-mesh.com>
660+
Simon Wunderlich <sw@simonwunderlich.de> <siwu@hrz.tu-chemnitz.de>
647661
Sricharan Ramabadhran <quic_srichara@quicinc.com> <sricharan@codeaurora.org>
648662
Srinivas Ramana <quic_sramana@quicinc.com> <sramana@codeaurora.org>
649663
Sriram R <quic_srirrama@quicinc.com> <srirrama@codeaurora.org>
@@ -664,6 +678,11 @@ Sudarshan Rajagopalan <quic_sudaraja@quicinc.com> <sudaraja@codeaurora.org>
664678
Sudeep Holla <sudeep.holla@arm.com> Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
665679
Sumit Semwal <sumit.semwal@ti.com>
666680
Surabhi Vishnoi <quic_svishnoi@quicinc.com> <svishnoi@codeaurora.org>
681+
Sven Eckelmann <sven@narfation.org> <seckelmann@datto.com>
682+
Sven Eckelmann <sven@narfation.org> <sven.eckelmann@gmx.de>
683+
Sven Eckelmann <sven@narfation.org> <sven.eckelmann@open-mesh.com>
684+
Sven Eckelmann <sven@narfation.org> <sven.eckelmann@openmesh.com>
685+
Sven Eckelmann <sven@narfation.org> <sven@open-mesh.com>
667686
Takashi YOSHII <takashi.yoshii.zj@renesas.com>
668687
Tamizh Chelvam Raja <quic_tamizhr@quicinc.com> <tamizhr@codeaurora.org>
669688
Taniya Das <quic_tdas@quicinc.com> <tdas@codeaurora.org>

Documentation/networking/batman-adv.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,5 @@ Mailing-list:
164164

165165
You can also contact the Authors:
166166

167-
* Marek Lindner <mareklindner@neomailbox.ch>
167+
* Marek Lindner <marek.lindner@mailbox.org>
168168
* Simon Wunderlich <sw@simonwunderlich.de>

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3874,9 +3874,9 @@ S: Maintained
38743874
F: drivers/platform/x86/barco-p50-gpio.c
38753875

38763876
BATMAN ADVANCED
3877-
M: Marek Lindner <mareklindner@neomailbox.ch>
3877+
M: Marek Lindner <marek.lindner@mailbox.org>
38783878
M: Simon Wunderlich <sw@simonwunderlich.de>
3879-
M: Antonio Quartulli <a@unstable.cc>
3879+
M: Antonio Quartulli <antonio@mandelbit.com>
38803880
M: Sven Eckelmann <sven@narfation.org>
38813881
L: b.a.t.m.a.n@lists.open-mesh.org (moderated for non-subscribers)
38823882
S: Maintained

net/batman-adv/bridge_loop_avoidance.c

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/compiler.h>
1313
#include <linux/container_of.h>
1414
#include <linux/crc16.h>
15+
#include <linux/err.h>
1516
#include <linux/errno.h>
1617
#include <linux/etherdevice.h>
1718
#include <linux/gfp.h>
@@ -38,7 +39,6 @@
3839
#include <net/arp.h>
3940
#include <net/genetlink.h>
4041
#include <net/netlink.h>
41-
#include <net/sock.h>
4242
#include <uapi/linux/batadv_packet.h>
4343
#include <uapi/linux/batman_adv.h>
4444

@@ -47,7 +47,6 @@
4747
#include "log.h"
4848
#include "netlink.h"
4949
#include "originator.h"
50-
#include "soft-interface.h"
5150
#include "translation-table.h"
5251

5352
static const u8 batadv_announce_mac[4] = {0x43, 0x05, 0x43, 0x05};
@@ -2233,25 +2232,16 @@ int batadv_bla_claim_dump(struct sk_buff *msg, struct netlink_callback *cb)
22332232
{
22342233
struct batadv_hard_iface *primary_if = NULL;
22352234
int portid = NETLINK_CB(cb->skb).portid;
2236-
struct net *net = sock_net(cb->skb->sk);
22372235
struct net_device *soft_iface;
22382236
struct batadv_hashtable *hash;
22392237
struct batadv_priv *bat_priv;
22402238
int bucket = cb->args[0];
22412239
int idx = cb->args[1];
2242-
int ifindex;
22432240
int ret = 0;
22442241

2245-
ifindex = batadv_netlink_get_ifindex(cb->nlh,
2246-
BATADV_ATTR_MESH_IFINDEX);
2247-
if (!ifindex)
2248-
return -EINVAL;
2249-
2250-
soft_iface = dev_get_by_index(net, ifindex);
2251-
if (!soft_iface || !batadv_softif_is_valid(soft_iface)) {
2252-
ret = -ENODEV;
2253-
goto out;
2254-
}
2242+
soft_iface = batadv_netlink_get_softif(cb);
2243+
if (IS_ERR(soft_iface))
2244+
return PTR_ERR(soft_iface);
22552245

22562246
bat_priv = netdev_priv(soft_iface);
22572247
hash = bat_priv->bla.claim_hash;
@@ -2403,25 +2393,16 @@ int batadv_bla_backbone_dump(struct sk_buff *msg, struct netlink_callback *cb)
24032393
{
24042394
struct batadv_hard_iface *primary_if = NULL;
24052395
int portid = NETLINK_CB(cb->skb).portid;
2406-
struct net *net = sock_net(cb->skb->sk);
24072396
struct net_device *soft_iface;
24082397
struct batadv_hashtable *hash;
24092398
struct batadv_priv *bat_priv;
24102399
int bucket = cb->args[0];
24112400
int idx = cb->args[1];
2412-
int ifindex;
24132401
int ret = 0;
24142402

2415-
ifindex = batadv_netlink_get_ifindex(cb->nlh,
2416-
BATADV_ATTR_MESH_IFINDEX);
2417-
if (!ifindex)
2418-
return -EINVAL;
2419-
2420-
soft_iface = dev_get_by_index(net, ifindex);
2421-
if (!soft_iface || !batadv_softif_is_valid(soft_iface)) {
2422-
ret = -ENODEV;
2423-
goto out;
2424-
}
2403+
soft_iface = batadv_netlink_get_softif(cb);
2404+
if (IS_ERR(soft_iface))
2405+
return PTR_ERR(soft_iface);
24252406

24262407
bat_priv = netdev_priv(soft_iface);
24272408
hash = bat_priv->bla.backbone_hash;

net/batman-adv/distributed-arp-table.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#include "distributed-arp-table.h"
88
#include "main.h"
99

10-
#include <linux/unaligned.h>
1110
#include <linux/atomic.h>
1211
#include <linux/bitops.h>
1312
#include <linux/byteorder/generic.h>
1413
#include <linux/container_of.h>
14+
#include <linux/err.h>
1515
#include <linux/errno.h>
1616
#include <linux/etherdevice.h>
1717
#include <linux/gfp.h>
@@ -32,11 +32,11 @@
3232
#include <linux/stddef.h>
3333
#include <linux/string.h>
3434
#include <linux/udp.h>
35+
#include <linux/unaligned.h>
3536
#include <linux/workqueue.h>
3637
#include <net/arp.h>
3738
#include <net/genetlink.h>
3839
#include <net/netlink.h>
39-
#include <net/sock.h>
4040
#include <uapi/linux/batman_adv.h>
4141

4242
#include "bridge_loop_avoidance.h"
@@ -46,7 +46,6 @@
4646
#include "netlink.h"
4747
#include "originator.h"
4848
#include "send.h"
49-
#include "soft-interface.h"
5049
#include "translation-table.h"
5150
#include "tvlv.h"
5251

@@ -937,25 +936,16 @@ int batadv_dat_cache_dump(struct sk_buff *msg, struct netlink_callback *cb)
937936
{
938937
struct batadv_hard_iface *primary_if = NULL;
939938
int portid = NETLINK_CB(cb->skb).portid;
940-
struct net *net = sock_net(cb->skb->sk);
941939
struct net_device *soft_iface;
942940
struct batadv_hashtable *hash;
943941
struct batadv_priv *bat_priv;
944942
int bucket = cb->args[0];
945943
int idx = cb->args[1];
946-
int ifindex;
947944
int ret = 0;
948945

949-
ifindex = batadv_netlink_get_ifindex(cb->nlh,
950-
BATADV_ATTR_MESH_IFINDEX);
951-
if (!ifindex)
952-
return -EINVAL;
953-
954-
soft_iface = dev_get_by_index(net, ifindex);
955-
if (!soft_iface || !batadv_softif_is_valid(soft_iface)) {
956-
ret = -ENODEV;
957-
goto out;
958-
}
946+
soft_iface = batadv_netlink_get_softif(cb);
947+
if (IS_ERR(soft_iface))
948+
return PTR_ERR(soft_iface);
959949

960950
bat_priv = netdev_priv(soft_iface);
961951
hash = bat_priv->dat.hash;

net/batman-adv/gateway_client.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/atomic.h>
1111
#include <linux/byteorder/generic.h>
1212
#include <linux/container_of.h>
13+
#include <linux/err.h>
1314
#include <linux/errno.h>
1415
#include <linux/etherdevice.h>
1516
#include <linux/gfp.h>
@@ -31,7 +32,6 @@
3132
#include <linux/sprintf.h>
3233
#include <linux/stddef.h>
3334
#include <linux/udp.h>
34-
#include <net/sock.h>
3535
#include <uapi/linux/batadv_packet.h>
3636
#include <uapi/linux/batman_adv.h>
3737

@@ -40,7 +40,6 @@
4040
#include "netlink.h"
4141
#include "originator.h"
4242
#include "routing.h"
43-
#include "soft-interface.h"
4443
#include "translation-table.h"
4544

4645
/* These are the offsets of the "hw type" and "hw address length" in the dhcp
@@ -502,22 +501,13 @@ void batadv_gw_node_free(struct batadv_priv *bat_priv)
502501
int batadv_gw_dump(struct sk_buff *msg, struct netlink_callback *cb)
503502
{
504503
struct batadv_hard_iface *primary_if = NULL;
505-
struct net *net = sock_net(cb->skb->sk);
506504
struct net_device *soft_iface;
507505
struct batadv_priv *bat_priv;
508-
int ifindex;
509506
int ret;
510507

511-
ifindex = batadv_netlink_get_ifindex(cb->nlh,
512-
BATADV_ATTR_MESH_IFINDEX);
513-
if (!ifindex)
514-
return -EINVAL;
515-
516-
soft_iface = dev_get_by_index(net, ifindex);
517-
if (!soft_iface || !batadv_softif_is_valid(soft_iface)) {
518-
ret = -ENODEV;
519-
goto out;
520-
}
508+
soft_iface = batadv_netlink_get_softif(cb);
509+
if (IS_ERR(soft_iface))
510+
return PTR_ERR(soft_iface);
521511

522512
bat_priv = netdev_priv(soft_iface);
523513

net/batman-adv/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,13 @@ unsigned short batadv_get_vid(struct sk_buff *skb, size_t header_len)
637637

638638
vhdr = (struct vlan_ethhdr *)(skb->data + header_len);
639639
vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;
640+
641+
/* VID 0 is only used to indicate "priority tag" frames which only
642+
* contain priority information and no VID.
643+
*/
644+
if (vid == 0)
645+
return BATADV_NO_FLAGS;
646+
640647
vid |= BATADV_VLAN_HAS_TAG;
641648

642649
return vid;

net/batman-adv/main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#ifndef _NET_BATMAN_ADV_MAIN_H_
88
#define _NET_BATMAN_ADV_MAIN_H_
99

10-
#define BATADV_DRIVER_AUTHOR "Marek Lindner <mareklindner@neomailbox.ch>, " \
10+
#define BATADV_DRIVER_AUTHOR "Marek Lindner <marek.lindner@mailbox.org>, " \
1111
"Simon Wunderlich <sw@simonwunderlich.de>"
1212
#define BATADV_DRIVER_DESC "B.A.T.M.A.N. advanced"
1313
#define BATADV_DRIVER_DEVICE "batman-adv"
1414

1515
#ifndef BATADV_SOURCE_VERSION
16-
#define BATADV_SOURCE_VERSION "2024.3"
16+
#define BATADV_SOURCE_VERSION "2025.0"
1717
#endif
1818

1919
/* B.A.T.M.A.N. parameters */

net/batman-adv/multicast.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/bug.h>
1313
#include <linux/byteorder/generic.h>
1414
#include <linux/container_of.h>
15+
#include <linux/err.h>
1516
#include <linux/errno.h>
1617
#include <linux/etherdevice.h>
1718
#include <linux/gfp.h>
@@ -46,7 +47,6 @@
4647
#include <net/ip.h>
4748
#include <net/ipv6.h>
4849
#include <net/netlink.h>
49-
#include <net/sock.h>
5050
#include <uapi/linux/batadv_packet.h>
5151
#include <uapi/linux/batman_adv.h>
5252

@@ -56,7 +56,6 @@
5656
#include "log.h"
5757
#include "netlink.h"
5858
#include "send.h"
59-
#include "soft-interface.h"
6059
#include "translation-table.h"
6160
#include "tvlv.h"
6261

@@ -2104,21 +2103,13 @@ batadv_mcast_netlink_get_primary(struct netlink_callback *cb,
21042103
struct batadv_hard_iface **primary_if)
21052104
{
21062105
struct batadv_hard_iface *hard_iface = NULL;
2107-
struct net *net = sock_net(cb->skb->sk);
21082106
struct net_device *soft_iface;
21092107
struct batadv_priv *bat_priv;
2110-
int ifindex;
21112108
int ret = 0;
21122109

2113-
ifindex = batadv_netlink_get_ifindex(cb->nlh, BATADV_ATTR_MESH_IFINDEX);
2114-
if (!ifindex)
2115-
return -EINVAL;
2116-
2117-
soft_iface = dev_get_by_index(net, ifindex);
2118-
if (!soft_iface || !batadv_softif_is_valid(soft_iface)) {
2119-
ret = -ENODEV;
2120-
goto out;
2121-
}
2110+
soft_iface = batadv_netlink_get_softif(cb);
2111+
if (IS_ERR(soft_iface))
2112+
return PTR_ERR(soft_iface);
21222113

21232114
bat_priv = netdev_priv(soft_iface);
21242115

0 commit comments

Comments
 (0)