Skip to content

Commit 03b9674

Browse files
committed
Merge tag 'batadv-next-for-davem-20190213' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== This feature/cleanup patchset includes the following patches: - fix memory leak in in batadv_dat_put_dhcp, by Martin Weinelt - fix typo, by Sven Eckelmann - netlink restructuring patch series (part 2), by Sven Eckelmann (19 patches) ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents e7c2e3b + 7e6f461 commit 03b9674

File tree

10 files changed

+1206
-148
lines changed

10 files changed

+1206
-148
lines changed

include/uapi/linux/batadv_packet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ struct batadv_ogm_packet {
229229
* @packet_type: batman-adv packet type, part of the general header
230230
* @version: batman-adv protocol version, part of the general header
231231
* @ttl: time to live for this packet, part of the general header
232-
* @flags: reseved for routing relevant flags - currently always 0
232+
* @flags: reserved for routing relevant flags - currently always 0
233233
* @seqno: sequence number
234234
* @orig: originator mac address
235235
* @tvlv_len: length of the appended tvlv buffer (in bytes)

include/uapi/linux/batman_adv.h

Lines changed: 185 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#define BATADV_NL_NAME "batadv"
2929

30+
#define BATADV_NL_MCAST_GROUP_CONFIG "config"
3031
#define BATADV_NL_MCAST_GROUP_TPMETER "tpmeter"
3132

3233
/**
@@ -138,6 +139,20 @@ enum batadv_mcast_flags_priv {
138139
BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING = (1 << 4),
139140
};
140141

142+
/**
143+
* enum batadv_gw_modes - gateway mode of node
144+
*/
145+
enum batadv_gw_modes {
146+
/** @BATADV_GW_MODE_OFF: gw mode disabled */
147+
BATADV_GW_MODE_OFF,
148+
149+
/** @BATADV_GW_MODE_CLIENT: send DHCP requests to gw servers */
150+
BATADV_GW_MODE_CLIENT,
151+
152+
/** @BATADV_GW_MODE_SERVER: announce itself as gatway server */
153+
BATADV_GW_MODE_SERVER,
154+
};
155+
141156
/**
142157
* enum batadv_nl_attrs - batman-adv netlink attributes
143158
*/
@@ -344,6 +359,138 @@ enum batadv_nl_attrs {
344359
*/
345360
BATADV_ATTR_MCAST_FLAGS_PRIV,
346361

362+
/**
363+
* @BATADV_ATTR_VLANID: VLAN id on top of soft interface
364+
*/
365+
BATADV_ATTR_VLANID,
366+
367+
/**
368+
* @BATADV_ATTR_AGGREGATED_OGMS_ENABLED: whether the batman protocol
369+
* messages of the mesh interface shall be aggregated or not.
370+
*/
371+
BATADV_ATTR_AGGREGATED_OGMS_ENABLED,
372+
373+
/**
374+
* @BATADV_ATTR_AP_ISOLATION_ENABLED: whether the data traffic going
375+
* from a wireless client to another wireless client will be silently
376+
* dropped.
377+
*/
378+
BATADV_ATTR_AP_ISOLATION_ENABLED,
379+
380+
/**
381+
* @BATADV_ATTR_ISOLATION_MARK: the isolation mark which is used to
382+
* classify clients as "isolated" by the Extended Isolation feature.
383+
*/
384+
BATADV_ATTR_ISOLATION_MARK,
385+
386+
/**
387+
* @BATADV_ATTR_ISOLATION_MASK: the isolation (bit)mask which is used to
388+
* classify clients as "isolated" by the Extended Isolation feature.
389+
*/
390+
BATADV_ATTR_ISOLATION_MASK,
391+
392+
/**
393+
* @BATADV_ATTR_BONDING_ENABLED: whether the data traffic going through
394+
* the mesh will be sent using multiple interfaces at the same time.
395+
*/
396+
BATADV_ATTR_BONDING_ENABLED,
397+
398+
/**
399+
* @BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED: whether the bridge loop
400+
* avoidance feature is enabled. This feature detects and avoids loops
401+
* between the mesh and devices bridged with the soft interface
402+
*/
403+
BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED,
404+
405+
/**
406+
* @BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED: whether the distributed
407+
* arp table feature is enabled. This feature uses a distributed hash
408+
* table to answer ARP requests without flooding the request through
409+
* the whole mesh.
410+
*/
411+
BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED,
412+
413+
/**
414+
* @BATADV_ATTR_FRAGMENTATION_ENABLED: whether the data traffic going
415+
* through the mesh will be fragmented or silently discarded if the
416+
* packet size exceeds the outgoing interface MTU.
417+
*/
418+
BATADV_ATTR_FRAGMENTATION_ENABLED,
419+
420+
/**
421+
* @BATADV_ATTR_GW_BANDWIDTH_DOWN: defines the download bandwidth which
422+
* is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set
423+
* to 'server'.
424+
*/
425+
BATADV_ATTR_GW_BANDWIDTH_DOWN,
426+
427+
/**
428+
* @BATADV_ATTR_GW_BANDWIDTH_UP: defines the upload bandwidth which
429+
* is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set
430+
* to 'server'.
431+
*/
432+
BATADV_ATTR_GW_BANDWIDTH_UP,
433+
434+
/**
435+
* @BATADV_ATTR_GW_MODE: defines the state of the gateway features.
436+
* Possible values are specified in enum batadv_gw_modes
437+
*/
438+
BATADV_ATTR_GW_MODE,
439+
440+
/**
441+
* @BATADV_ATTR_GW_SEL_CLASS: defines the selection criteria this node
442+
* will use to choose a gateway if gw_mode was set to 'client'.
443+
*/
444+
BATADV_ATTR_GW_SEL_CLASS,
445+
446+
/**
447+
* @BATADV_ATTR_HOP_PENALTY: defines the penalty which will be applied
448+
* to an originator message's tq-field on every hop.
449+
*/
450+
BATADV_ATTR_HOP_PENALTY,
451+
452+
/**
453+
* @BATADV_ATTR_LOG_LEVEL: bitmask with to define which debug messages
454+
* should be send to the debug log/trace ring buffer
455+
*/
456+
BATADV_ATTR_LOG_LEVEL,
457+
458+
/**
459+
* @BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED: whether multicast
460+
* optimizations should be replaced by simple broadcast-like flooding
461+
* of multicast packets. If set to non-zero then all nodes in the mesh
462+
* are going to use classic flooding for any multicast packet with no
463+
* optimizations.
464+
*/
465+
BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED,
466+
467+
/**
468+
* @BATADV_ATTR_NETWORK_CODING_ENABLED: whether Network Coding (using
469+
* some magic to send fewer wifi packets but still the same content) is
470+
* enabled or not.
471+
*/
472+
BATADV_ATTR_NETWORK_CODING_ENABLED,
473+
474+
/**
475+
* @BATADV_ATTR_ORIG_INTERVAL: defines the interval in milliseconds in
476+
* which batman sends its protocol messages.
477+
*/
478+
BATADV_ATTR_ORIG_INTERVAL,
479+
480+
/**
481+
* @BATADV_ATTR_ELP_INTERVAL: defines the interval in milliseconds in
482+
* which batman emits probing packets for neighbor sensing (ELP).
483+
*/
484+
BATADV_ATTR_ELP_INTERVAL,
485+
486+
/**
487+
* @BATADV_ATTR_THROUGHPUT_OVERRIDE: defines the throughput value to be
488+
* used by B.A.T.M.A.N. V when estimating the link throughput using
489+
* this interface. If the value is set to 0 then batman-adv will try to
490+
* estimate the throughput by itself.
491+
*/
492+
BATADV_ATTR_THROUGHPUT_OVERRIDE,
493+
347494
/* add attributes above here, update the policy in netlink.c */
348495

349496
/**
@@ -372,10 +519,14 @@ enum batadv_nl_commands {
372519
BATADV_CMD_UNSPEC,
373520

374521
/**
375-
* @BATADV_CMD_GET_MESH_INFO: Query basic information about batman-adv
376-
* device
522+
* @BATADV_CMD_GET_MESH: Get attributes from softif/mesh
523+
*/
524+
BATADV_CMD_GET_MESH,
525+
526+
/**
527+
* @BATADV_CMD_GET_MESH_INFO: Alias for @BATADV_CMD_GET_MESH
377528
*/
378-
BATADV_CMD_GET_MESH_INFO,
529+
BATADV_CMD_GET_MESH_INFO = BATADV_CMD_GET_MESH,
379530

380531
/**
381532
* @BATADV_CMD_TP_METER: Start a tp meter session
@@ -393,9 +544,15 @@ enum batadv_nl_commands {
393544
BATADV_CMD_GET_ROUTING_ALGOS,
394545

395546
/**
396-
* @BATADV_CMD_GET_HARDIFS: Query list of hard interfaces
547+
* @BATADV_CMD_GET_HARDIF: Get attributes from a hardif of the
548+
* current softif
397549
*/
398-
BATADV_CMD_GET_HARDIFS,
550+
BATADV_CMD_GET_HARDIF,
551+
552+
/**
553+
* @BATADV_CMD_GET_HARDIFS: Alias for @BATADV_CMD_GET_HARDIF
554+
*/
555+
BATADV_CMD_GET_HARDIFS = BATADV_CMD_GET_HARDIF,
399556

400557
/**
401558
* @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations
@@ -443,6 +600,29 @@ enum batadv_nl_commands {
443600
*/
444601
BATADV_CMD_GET_MCAST_FLAGS,
445602

603+
/**
604+
* @BATADV_CMD_SET_MESH: Set attributes for softif/mesh
605+
*/
606+
BATADV_CMD_SET_MESH,
607+
608+
/**
609+
* @BATADV_CMD_SET_HARDIF: Set attributes for hardif of the
610+
* current softif
611+
*/
612+
BATADV_CMD_SET_HARDIF,
613+
614+
/**
615+
* @BATADV_CMD_GET_VLAN: Get attributes from a VLAN of the
616+
* current softif
617+
*/
618+
BATADV_CMD_GET_VLAN,
619+
620+
/**
621+
* @BATADV_CMD_SET_VLAN: Set attributes for VLAN of the
622+
* current softif
623+
*/
624+
BATADV_CMD_SET_VLAN,
625+
446626
/* add new commands above here */
447627

448628
/**

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,8 @@ static void batadv_dat_put_dhcp(struct batadv_priv *bat_priv, u8 *chaddr,
17111711
batadv_dat_send_data(bat_priv, skb, yiaddr, vid, BATADV_P_DAT_DHT_PUT);
17121712
batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT);
17131713

1714+
consume_skb(skb);
1715+
17141716
batadv_dbg(BATADV_DBG_DAT, bat_priv,
17151717
"Snooped from outgoing DHCPACK (server address): %pI4, %pM (vid: %i)\n",
17161718
&ip_dst, hw_dst, batadv_print_vid(vid));

net/batman-adv/gateway_client.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
#include <uapi/linux/batadv_packet.h>
4848
#include <uapi/linux/batman_adv.h>
4949

50-
#include "gateway_common.h"
5150
#include "hard-interface.h"
5251
#include "log.h"
5352
#include "netlink.h"

net/batman-adv/gateway_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/stddef.h>
2929
#include <linux/string.h>
3030
#include <uapi/linux/batadv_packet.h>
31+
#include <uapi/linux/batman_adv.h>
3132

3233
#include "gateway_client.h"
3334
#include "log.h"

net/batman-adv/gateway_common.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525

2626
struct net_device;
2727

28-
enum batadv_gw_modes {
29-
BATADV_GW_MODE_OFF,
30-
BATADV_GW_MODE_CLIENT,
31-
BATADV_GW_MODE_SERVER,
32-
};
33-
3428
/**
3529
* enum batadv_bandwidth_units - bandwidth unit types
3630
*/

0 commit comments

Comments
 (0)