An error occurred fetching the project authors.
  1. 07 Nov, 2022 1 commit
    • Jakub Kicinski's avatar
      genetlink: introduce split op representation · 20b0b53a
      Jakub Kicinski authored
      We currently have two forms of operations - small ops and "full" ops
      (or just ops). The former does not have pointers for some of the less
      commonly used features (namely dump start/done and policy).
      
      The "full" ops, however, still don't contain all the necessary
      information. In particular the policy is per command ID, while
      do and dump often accept different attributes. It's also not
      possible to define different pre_doit and post_doit callbacks
      for different commands within the family.
      
      At the same time a lot of commands do not support dumping and
      therefore all the dump-related information is wasted space.
      
      Create a new command representation which can hold info about
      a do implementation or a dump implementation, but not both at
      the same time.
      
      Use this new representation on the command execution path
      (genl_family_rcv_msg) as we either run a do or a dump and
      don't have to create a "full" op there.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20b0b53a
  2. 29 Aug, 2022 1 commit
    • Jakub Kicinski's avatar
      genetlink: start to validate reserved header bytes · 9c5d03d3
      Jakub Kicinski authored
      We had historically not checked that genlmsghdr.reserved
      is 0 on input which prevents us from using those precious
      bytes in the future.
      
      One use case would be to extend the cmd field, which is
      currently just 8 bits wide and 256 is not a lot of commands
      for some core families.
      
      To make sure that new families do the right thing by default
      put the onus of opting out of validation on existing families.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Acked-by: Paul Moore <paul@paul-moore.com> (NetLabel)
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c5d03d3
  3. 15 Nov, 2021 1 commit
    • Linus Lüssing's avatar
      batman-adv: allow netlink usage in unprivileged containers · 9057d6c2
      Linus Lüssing authored
      Currently, creating a batman-adv interface in an unprivileged LXD
      container and attaching secondary interfaces to it with "ip" or "batctl"
      works fine. However all batctl debug and configuration commands
      fail:
      
        root@container:~# batctl originators
        Error received: Operation not permitted
        root@container:~# batctl orig_interval
        1000
        root@container:~# batctl orig_interval 2000
        root@container:~# batctl orig_interval
        1000
      
      To fix this change the generic netlink permissions from GENL_ADMIN_PERM
      to GENL_UNS_ADMIN_PERM. This way a batman-adv interface is fully
      maintainable as root from within a user namespace, from an unprivileged
      container.
      
      All except one batman-adv netlink setting are per interface and do not
      leak information or change settings from the host system and are
      therefore save to retrieve or modify as root from within an unprivileged
      container.
      
      "batctl routing_algo" / BATADV_CMD_GET_ROUTING_ALGOS is the only
      exception: It provides the batman-adv kernel module wide default routing
      algorithm. However it is read-only from netlink and an unprivileged
      container is still not allowed to modify
      /sys/module/batman_adv/parameters/routing_algo. Instead it is advised to
      use the newly introduced "batctl if create routing_algo RA_NAME" /
      IFLA_BATADV_ALGO_NAME to set the routing algorithm on interface
      creation, which already works fine in an unprivileged container.
      
      Cc: Tycho Andersen <tycho@tycho.pizza>
      Signed-off-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      9057d6c2
  4. 20 Aug, 2021 1 commit
    • Sven Eckelmann's avatar
      batman-adv: Drop NULL check before dropping references · a2b7b148
      Sven Eckelmann authored
      The check if a batman-adv related object is NULL or not is now directly in
      the batadv_*_put functions. It is not needed anymore to perform this check
      outside these function:
      
      The changes were generated using a coccinelle semantic patch:
      
        @@
        expression E;
        @@
        - if (likely(E != NULL))
        (
        batadv_backbone_gw_put
        |
        batadv_claim_put
        |
        batadv_dat_entry_put
        |
        batadv_gw_node_put
        |
        batadv_hardif_neigh_put
        |
        batadv_hardif_put
        |
        batadv_nc_node_put
        |
        batadv_nc_path_put
        |
        batadv_neigh_ifinfo_put
        |
        batadv_neigh_node_put
        |
        batadv_orig_ifinfo_put
        |
        batadv_orig_node_put
        |
        batadv_orig_node_vlan_put
        |
        batadv_softif_vlan_put
        |
        batadv_tp_vars_put
        |
        batadv_tt_global_entry_put
        |
        batadv_tt_local_entry_put
        |
        batadv_tt_orig_list_entry_put
        |
        batadv_tt_req_node_put
        |
        batadv_tvlv_container_put
        |
        batadv_tvlv_handler_put
        )(E);
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      a2b7b148
  5. 08 Aug, 2021 1 commit
    • Sven Eckelmann's avatar
      batman-adv: Drop NULL check before dropping references · 79a0bffb
      Sven Eckelmann authored
      The check if a batman-adv related object is NULL or not is now directly in
      the batadv_*_put functions. It is not needed anymore to perform this check
      outside these function:
      
      The changes were generated using a coccinelle semantic patch:
      
        @@
        expression E;
        @@
        - if (likely(E != NULL))
        (
        batadv_backbone_gw_put
        |
        batadv_claim_put
        |
        batadv_dat_entry_put
        |
        batadv_gw_node_put
        |
        batadv_hardif_neigh_put
        |
        batadv_hardif_put
        |
        batadv_nc_node_put
        |
        batadv_nc_path_put
        |
        batadv_neigh_ifinfo_put
        |
        batadv_neigh_node_put
        |
        batadv_orig_ifinfo_put
        |
        batadv_orig_node_put
        |
        batadv_orig_node_vlan_put
        |
        batadv_softif_vlan_put
        |
        batadv_tp_vars_put
        |
        batadv_tt_global_entry_put
        |
        batadv_tt_local_entry_put
        |
        batadv_tt_orig_list_entry_put
        |
        batadv_tt_req_node_put
        |
        batadv_tvlv_container_put
        |
        batadv_tvlv_handler_put
        )(E);
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      79a0bffb
  6. 17 May, 2021 1 commit
    • Sven Eckelmann's avatar
      batman-adv: Always send iface index+name in genlmsg · d295345a
      Sven Eckelmann authored
      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: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      d295345a
  7. 06 Feb, 2021 2 commits
  8. 04 Dec, 2020 1 commit
  9. 03 Oct, 2020 1 commit
  10. 26 Jun, 2020 2 commits
  11. 31 Dec, 2019 1 commit
  12. 14 Aug, 2019 1 commit
    • Eric Dumazet's avatar
      batman-adv: fix uninit-value in batadv_netlink_get_ifindex() · 3ee1bb7a
      Eric Dumazet authored
      batadv_netlink_get_ifindex() needs to make sure user passed
      a correct u32 attribute.
      
      syzbot reported :
      BUG: KMSAN: uninit-value in batadv_netlink_dump_hardif+0x70d/0x880 net/batman-adv/netlink.c:968
      CPU: 1 PID: 11705 Comm: syz-executor888 Not tainted 5.1.0+ #1
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0x191/0x1f0 lib/dump_stack.c:113
       kmsan_report+0x130/0x2a0 mm/kmsan/kmsan.c:622
       __msan_warning+0x75/0xe0 mm/kmsan/kmsan_instr.c:310
       batadv_netlink_dump_hardif+0x70d/0x880 net/batman-adv/netlink.c:968
       genl_lock_dumpit+0xc6/0x130 net/netlink/genetlink.c:482
       netlink_dump+0xa84/0x1ab0 net/netlink/af_netlink.c:2253
       __netlink_dump_start+0xa3a/0xb30 net/netlink/af_netlink.c:2361
       genl_family_rcv_msg net/netlink/genetlink.c:550 [inline]
       genl_rcv_msg+0xfc1/0x1a40 net/netlink/genetlink.c:627
       netlink_rcv_skb+0x431/0x620 net/netlink/af_netlink.c:2486
       genl_rcv+0x63/0x80 net/netlink/genetlink.c:638
       netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
       netlink_unicast+0xf3e/0x1020 net/netlink/af_netlink.c:1337
       netlink_sendmsg+0x127e/0x12f0 net/netlink/af_netlink.c:1926
       sock_sendmsg_nosec net/socket.c:651 [inline]
       sock_sendmsg net/socket.c:661 [inline]
       ___sys_sendmsg+0xcc6/0x1200 net/socket.c:2260
       __sys_sendmsg net/socket.c:2298 [inline]
       __do_sys_sendmsg net/socket.c:2307 [inline]
       __se_sys_sendmsg+0x305/0x460 net/socket.c:2305
       __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2305
       do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291
       entry_SYSCALL_64_after_hwframe+0x63/0xe7
      RIP: 0033:0x440209
      
      Fixes: b60620cf ("batman-adv: netlink: hardif query")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      3ee1bb7a
  13. 25 May, 2019 2 commits
  14. 27 Apr, 2019 1 commit
    • Johannes Berg's avatar
      genetlink: optionally validate strictly/dumps · ef6243ac
      Johannes Berg authored
      Add options to strictly validate messages and dump messages,
      sometimes perhaps validating dump messages non-strictly may
      be required, so add an option for that as well.
      
      Since none of this can really be applied to existing commands,
      set the options everwhere using the following spatch:
      
          @@
          identifier ops;
          expression X;
          @@
          struct genl_ops ops[] = {
          ...,
           {
                  .cmd = X,
          +       .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
                  ...
           },
          ...
          };
      
      For new commands one should just not copy the .validate 'opt-out'
      flags and thus get strict validation.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef6243ac
  15. 25 Mar, 2019 2 commits
  16. 22 Mar, 2019 1 commit
    • Johannes Berg's avatar
      genetlink: make policy common to family · 3b0f31f2
      Johannes Berg authored
      Since maxattr is common, the policy can't really differ sanely,
      so make it common as well.
      
      The only user that did in fact manage to make a non-common policy
      is taskstats, which has to be really careful about it (since it's
      still using a common maxattr!). This is no longer supported, but
      we can fake it using pre_doit.
      
      This reduces the size of e.g. nl80211.o (which has lots of commands):
      
         text	   data	    bss	    dec	    hex	filename
       398745	  14323	   2240	 415308	  6564c	net/wireless/nl80211.o (before)
       397913	  14331	   2240	 414484	  65314	net/wireless/nl80211.o (after)
      --------------------------------
         -832      +8       0    -824
      
      Which is obviously just 8 bytes for each command, and an added 8
      bytes for the new policy pointer. I'm not sure why the ops list is
      counted as .text though.
      
      Most of the code transformations were done using the following spatch:
          @ops@
          identifier OPS;
          expression POLICY;
          @@
          struct genl_ops OPS[] = {
          ...,
           {
          -	.policy = POLICY,
           },
          ...
          };
      
          @@
          identifier ops.OPS;
          expression ops.POLICY;
          identifier fam;
          expression M;
          @@
          struct genl_family fam = {
                  .ops = OPS,
                  .maxattr = M,
          +       .policy = POLICY,
                  ...
          };
      
      This also gets rid of devlink_nl_cmd_region_read_dumpit() accessing
      the cb->data as ops, which we want to change in a later genl patch.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b0f31f2
  17. 09 Feb, 2019 19 commits
    • Sven Eckelmann's avatar
      batman-adv: Trigger genl notification on sysfs config change · 7e6f461e
      Sven Eckelmann authored
      The generic netlink code is expected to trigger notification messages when
      configuration might have been changed. But the configuration of batman-adv
      is most of the time still done using sysfs. So the sysfs interface should
      also trigger the corresponding netlink messages via the "config" multicast
      group.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      7e6f461e
    • Sven Eckelmann's avatar
      batman-adv: Add throughput_override hardif genl configuration · 9a182242
      Sven Eckelmann authored
      The B.A.T.M.A.N. V implementation tries to estimate the link throughput of
      an interface to an originator using different automatic methods. It is
      still possible to overwrite it the link throughput for all reachable
      originators via this interface.
      
      The BATADV_CMD_SET_HARDIF/BATADV_CMD_GET_HARDIF commands allow to set/get
      the configuration of this feature using the u32
      BATADV_ATTR_THROUGHPUT_OVERRIDE attribute. The used unit is in 100 Kbit/s.
      If the value is set to 0 then batman-adv will try to estimate the
      throughput by itself.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      9a182242
    • Sven Eckelmann's avatar
      batman-adv: Add elp_interval hardif genl configuration · a1080082
      Sven Eckelmann authored
      The ELP packets are transmitted every elp_interval milliseconds on an
      slave/hard-interface. This value can be changed using the configuration
      interface.
      
      The BATADV_CMD_SET_HARDIF/BATADV_CMD_GET_HARDIF commands allow to set/get
      the configuration of this feature using the u32 BATADV_ATTR_ELP_INTERVAL
      attribute.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      a1080082
    • Sven Eckelmann's avatar
      batman-adv: Add orig_interval mesh genl configuration · 7b751b39
      Sven Eckelmann authored
      The OGM packets are transmitted every orig_interval milliseconds. This
      value can be changed using the configuration interface.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the u32 BATADV_ATTR_ORIG_INTERVAL
      attribute.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      7b751b39
    • Sven Eckelmann's avatar
      batman-adv: Add network_coding mesh genl configuration · 6c57cde6
      Sven Eckelmann authored
      The mesh interface can use (in an homogeneous mesh) network coding, a
      mechanism that aims to increase the overall network throughput by fusing
      multiple packets in one transmission.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the BATADV_ATTR_NETWORK_CODING_ENABLED
      attribute. Setting the u8 to zero will disable this feature and setting it
      to something else is enabling this feature.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      6c57cde6
    • Sven Eckelmann's avatar
      batman-adv: Add multicast forceflood mesh genl configuration · f75b56bc
      Sven Eckelmann authored
      The mesh interface can optimize the flooding of multicast packets based on
      the content of the global translation tables. To disable this behavior and
      use the broadcast-like flooding of the packets, forceflood has to be
      enabled.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the
      BATADV_ATTR_MULTICAST_FORCEFLOOD_ENABLED attribute. Setting the u8 to zero
      will disable this feature (allowing multicast optimizations) and setting it
      to something else is enabling this feature (forcing simple flooding).
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      f75b56bc
    • Sven Eckelmann's avatar
      batman-adv: Add log_level mesh genl configuration · b85bd091
      Sven Eckelmann authored
      In contrast to other modules, batman-adv allows to set the debug message
      verbosity per mesh/soft-interface and not per module (via modparam).
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the u32 (bitmask) BATADV_ATTR_LOG_LEVEL
      attribute.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      b85bd091
    • Sven Eckelmann's avatar
      batman-adv: Add hop_penalty mesh genl configuration · bfc7f1be
      Sven Eckelmann authored
      The TQ (B.A.T.M.A.N. IV) and throughput values (B.A.T.M.A.N. V) are reduced
      when they are forwarded. One of the reductions is the penalty for
      traversing an additional hop. This hop_penalty (0-255) defines the
      percentage of reduction (0-100%).
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the u8 BATADV_ATTR_HOP_PENALTY
      attribute.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      bfc7f1be
    • Sven Eckelmann's avatar
      batman-adv: Add gateway mesh genl configuration · e2d0d35b
      Sven Eckelmann authored
      The mesh/soft-interface can optimize the handling of DHCP packets. Instead
      of flooding them through the whole mesh, it can be forwarded as unicast to
      a specific gateway server. The originator which injects the packets in the
      mesh has to select (based on sel_class thresholds) a responsible gateway
      server. This is done by switching this originator to the gw_mode client.
      The servers announce their forwarding bandwidth (download/upload) when the
      gw_mode server was selected.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the attributes:
      
      * u8 BATADV_ATTR_GW_MODE (0 == off, 1 == client, 2 == server)
      * u32 BATADV_ATTR_GW_BANDWIDTH_DOWN (in 100 kbit/s steps)
      * u32 BATADV_ATTR_GW_BANDWIDTH_UP (in 100 kbit/s steps)
      * u32 BATADV_ATTR_GW_SEL_CLASS
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      e2d0d35b
    • Sven Eckelmann's avatar
      batman-adv: Add fragmentation mesh genl configuration · 3e15b06e
      Sven Eckelmann authored
      The mesh interface can fragment unicast packets when the packet size
      exceeds the outgoing slave/hard-interface MTU.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the BATADV_ATTR_FRAGMENTATION_ENABLED
      attribute. Setting the u8 to zero will disable this feature and setting it
      to something else is enabling this feature.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      3e15b06e
    • Sven Eckelmann's avatar
      batman-adv: Add distributed_arp_table mesh genl configuration · a1c8de80
      Sven Eckelmann authored
      The mesh interface can use a distributed hash table to answer ARP requests
      without flooding the request through the whole mesh.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the
      BATADV_ATTR_DISTRIBUTED_ARP_TABLE_ENABLED attribute. Setting the u8 to zero
      will disable this feature and setting it to something else is enabling this
      feature.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      a1c8de80
    • Sven Eckelmann's avatar
      batman-adv: Add bridge_loop_avoidance mesh genl configuration · 43ff6105
      Sven Eckelmann authored
      The mesh interface can try to detect loops in the same mesh caused by
      (indirectly) bridged mesh/soft-interfaces of different nodes. Some of the
      loops can also be resolved without breaking the mesh.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the
      BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED attribute. Setting the u8 to zero
      will disable this feature and setting it to something else is enabling this
      feature.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      43ff6105
    • Sven Eckelmann's avatar
      batman-adv: Add bonding mesh genl configuration · d7e52506
      Sven Eckelmann authored
      The mesh interface can use multiple slave/hard-interface ports at the same
      time to transport the traffic to other nodes.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the BATADV_ATTR_BONDING_ENABLED
      attribute. Setting the u8 to zero will disable this feature and setting it
      to something else is enabling this feature.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      d7e52506
    • Sven Eckelmann's avatar
      batman-adv: Add ap_isolation mesh/vlan genl configuration · e43d16b8
      Sven Eckelmann authored
      The mesh interface can drop messages between clients to implement a
      mesh-wide AP isolation.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH and
      BATADV_CMD_SET_VLAN/BATADV_CMD_GET_VLAN commands allow to set/get the
      configuration of this feature using the BATADV_ATTR_AP_ISOLATION_ENABLED
      attribute. Setting the u8 to zero will disable this feature and setting it
      to something else is enabling this feature.
      
      This feature also requires that skbuff which should be handled as isolated
      are marked. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to
      set/get the mark/mask using the u32 attributes BATADV_ATTR_ISOLATION_MARK
      and BATADV_ATTR_ISOLATION_MASK.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      e43d16b8
    • Sven Eckelmann's avatar
      batman-adv: Add aggregated_ogms mesh genl configuration · 9ab4cee5
      Sven Eckelmann authored
      The mesh interface can delay OGM messages to aggregate different ogms
      together in a single OGM packet.
      
      The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the
      configuration of this feature using the BATADV_ATTR_AGGREGATED_OGMS_ENABLED
      attribute. Setting the u8 to zero will disable this feature and setting it
      to something else is enabling this feature.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      9ab4cee5
    • Sven Eckelmann's avatar
      batman-adv: Prepare framework for vlan genl config · 49e7e37c
      Sven Eckelmann authored
      The batman-adv configuration interface was implemented solely using sysfs.
      This approach was condemned by non-batadv developers as "huge mistake".
      Instead a netlink/genl based implementation was suggested.
      
      Beside the mesh/soft-interface specific configuration, the VLANs on top of
      the mesh/soft-interface have configuration settings. The genl interface
      reflects this by allowing to get/set it using the vlan specific commands
      BATADV_CMD_GET_VLAN/BATADV_CMD_SET_VLAN.
      
      The set command BATADV_CMD_SET_MESH will also notify interested userspace
      listeners of the "config" mcast group using the BATADV_CMD_SET_VLAN command
      message type that settings might have been changed and what the current
      values are.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      49e7e37c
    • Sven Eckelmann's avatar
      batman-adv: Prepare framework for hardif genl config · 5c55a40f
      Sven Eckelmann authored
      The batman-adv configuration interface was implemented solely using sysfs.
      This approach was condemned by non-batadv developers as "huge mistake".
      Instead a netlink/genl based implementation was suggested.
      
      Beside the mesh/soft-interface specific configuration, the
      slave/hard-interface have B.A.T.M.A.N. V specific configuration settings.
      The genl interface reflects this by allowing to get/set it using the
      hard-interface specific commands.
      
      The BATADV_CMD_GET_HARDIFS (or short version BATADV_CMD_GET_HARDIF) is
      reused as get command because it already allow sto dump the content of
      other information from the slave/hard-interface which are not yet
      configuration specific.
      
      The set command BATADV_CMD_SET_HARDIF will also notify interested userspace
      listeners of the "config" mcast group using the BATADV_CMD_SET_HARDIF
      command message type that settings might have been changed and what the
      current values are.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      5c55a40f
    • Sven Eckelmann's avatar
      batman-adv: Prepare framework for mesh genl config · 60040513
      Sven Eckelmann authored
      The batman-adv configuration interface was implemented solely using sysfs.
      This approach was condemned by non-batadv developers as "huge mistake".
      Instead a netlink/genl based implementation was suggested.
      
      The main objects for this configuration is the mesh/soft-interface object.
      Its actual object in memory already contains most of the available
      configuration settings. The genl interface reflects this by allowing to
      get/set it using the mesh specific commands.
      
      The BATADV_CMD_GET_MESH_INFO (or short version BATADV_CMD_GET_MESH) is
      reused as get command because it already provides the content of other
      information from the mesh/soft-interface which are not yet configuration
      specific.
      
      The set command BATADV_CMD_SET_MESH will also notify interested userspace
      listeners of the "config" mcast group using the BATADV_CMD_SET_MESH command
      message type that settings might have been changed and what the current
      values are.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      60040513
    • Sven Eckelmann's avatar
      batman-adv: Move common genl doit code pre/post hooks · c4a7a8d9
      Sven Eckelmann authored
      The commit ff4c92d8 ("genetlink: introduce pre_doit/post_doit hooks")
      intoduced a mechanism to run specific code for doit hooks before/after the
      hooks are run. Since all doit hooks are requiring the batadv softif, it
      should be retrieved/freed in these helpers to simplify the code.
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      c4a7a8d9
  18. 04 Jan, 2019 1 commit