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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 1a280c5 + 6ecc4fd commit 59372af

File tree

15 files changed

+251
-252
lines changed

15 files changed

+251
-252
lines changed

.mailmap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ Anirudh Ghayal <[email protected]> <[email protected]>
8383
8484
8585
86+
87+
88+
89+
90+
91+
92+
8693
8794
Archit Taneja <[email protected]>
8895
@@ -429,6 +436,8 @@ Marcin Nowakowski <[email protected]> <[email protected]>
429436
430437
431438
Marek Behún <[email protected]> Marek Behun <[email protected]>
439+
440+
432441
Mark Brown <[email protected]>
433442
434443
Markus Schneider-Pargmann <[email protected]> <[email protected]>
@@ -644,6 +653,11 @@ Simona Vetter <[email protected]> <[email protected]>
644653
645654
646655
Simon Kelley <[email protected]>
656+
657+
658+
659+
660+
647661
Sricharan Ramabadhran <[email protected]> <[email protected]>
648662
649663
@@ -664,6 +678,11 @@ Sudarshan Rajagopalan <[email protected]> <[email protected]>
664678
Sudeep Holla <[email protected]> Sudeep KarkadaNagesha <[email protected]>
665679
Sumit Semwal <[email protected]>
666680
681+
682+
683+
684+
685+
667686
Takashi YOSHII <[email protected]>
668687
Tamizh Chelvam Raja <[email protected]> <[email protected]>
669688

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 <[email protected]>
167+
* Marek Lindner <[email protected]>
168168
* Simon Wunderlich <[email protected]>

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 <[email protected]>
3877+
M: Marek Lindner <[email protected]>
38783878
M: Simon Wunderlich <[email protected]>
3879-
M: Antonio Quartulli <[email protected]>
3879+
M: Antonio Quartulli <[email protected]>
38803880
M: Sven Eckelmann <[email protected]>
38813881
L: [email protected] (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 <[email protected]>, " \
10+
#define BATADV_DRIVER_AUTHOR "Marek Lindner <[email protected]>, " \
1111
"Simon Wunderlich <[email protected]>"
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)