Merge pull request #478 from ecsv/batadv-for-19.07 master openwrt-19.07
authorSimon Wunderlich <sw@simonwunderlich.de>
Sun, 16 Jun 2019 09:27:08 +0000 (11:27 +0200)
committerGitHub <noreply@github.com>
Sun, 16 Jun 2019 09:27:08 +0000 (11:27 +0200)
batman-adv: Add support for B.A.T.M.A.N. V hardif settings

24 files changed:
alfred/Makefile
batctl/Makefile
batctl/patches/0001-batctl-Make-vlan-setting-explicit.patch [new file with mode: 0644]
batctl/patches/0002-batctl-Integrate-hardif-setting-framework.patch [new file with mode: 0644]
batctl/patches/0003-batctl-Add-elp_interval-setting-command.patch [new file with mode: 0644]
batctl/patches/0004-batctl-Add-throughput_override-setting-command.patch [new file with mode: 0644]
batman-adv/Config.in
batman-adv/Makefile
batman-adv/files/lib/netifd/proto/batadv.sh
batman-adv/files/lib/netifd/proto/batadv_hardif.sh
batman-adv/files/lib/netifd/proto/batadv_vlan.sh
batman-adv/patches/0001-Revert-batman-adv-convert-stream-like-files-from-non.patch [new file with mode: 0644]
batman-adv/patches/0002-Revert-batman-adv-compat-Drop-support-for-genl_ops-s.patch [new file with mode: 0644]
batman-adv/patches/0003-Revert-batman-adv-genetlink-optionally-validate-stri.patch [new file with mode: 0644]
batman-adv/patches/0004-Revert-batman-adv-genetlink-make-policy-common-to-fa.patch [new file with mode: 0644]
batman-adv/patches/0005-batman-adv-Fix-duplicated-OGMs-on-NETDEV_UP.patch [new file with mode: 0644]
batmand/Makefile
batmand/files/etc/config/batmand
batmand/files/etc/init.d/batmand
nodogsplash/Makefile
olsrd/Makefile
smcroute/Makefile [deleted file]
smcroute/files/smcroute.init [deleted file]
smcroute/patches/001-Make-output-of-build-id-optional.patch [deleted file]

index ec4840e..535e712 100644 (file)
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=alfred
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=alfred
-PKG_VERSION:=2019.1
+PKG_VERSION:=2019.2
 PKG_RELEASE:=0
 PKG_RELEASE:=0
-PKG_HASH:=7252a4d137a4cd38946e38b0c462487f09dd43fa18823c90d180ea7fce2b515b
+PKG_HASH:=b656f0e9a97a99c7531b6d49ebfd663451c16cdd275bbf7d48ff8daed3880bf2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
index 5b1d865..7cbb9bd 100644 (file)
@@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=batctl
 
 
 PKG_NAME:=batctl
 
-PKG_VERSION:=2019.1
-PKG_RELEASE:=0
-PKG_HASH:=e82d05f058d8b799d17ce6063e1bf5b83ef1fe42a0867b3e2e39545177469793
+PKG_VERSION:=2019.2
+PKG_RELEASE:=1
+PKG_HASH:=fb656208ff7d4cd8b1b422f60c9e6d8747302a347cbf6c199d7afa9b80f80ea3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
@@ -112,6 +112,7 @@ config-n := \
        claimtable \
        dat_cache \
        distributed_arp_table \
        claimtable \
        dat_cache \
        distributed_arp_table \
+       elp_interval \
        event \
        fragmentation \
        gateways \
        event \
        fragmentation \
        gateways \
@@ -119,9 +120,9 @@ config-n := \
        hop_penalty \
        interface \
        isolation_mark \
        hop_penalty \
        interface \
        isolation_mark \
-       log \
        loglevel \
        mcast_flags \
        loglevel \
        mcast_flags \
+       multicast_fanout \
        multicast_forceflood \
        multicast_mode \
        nc_nodes \
        multicast_forceflood \
        multicast_mode \
        nc_nodes \
@@ -133,6 +134,7 @@ config-n := \
        routing_algo \
        statistics \
        tcpdump \
        routing_algo \
        statistics \
        tcpdump \
+       throughput_override \
        throughputmeter \
        traceroute \
        transglobal \
        throughputmeter \
        traceroute \
        transglobal \
@@ -145,17 +147,20 @@ config-settings := \
        bonding \
        bridge_loop_avoidance \
        distributed_arp_table \
        bonding \
        bridge_loop_avoidance \
        distributed_arp_table \
+       elp_interval \
        fragmentation \
        gw_mode \
        hop_penalty \
        interface \
        isolation_mark \
        loglevel \
        fragmentation \
        gw_mode \
        hop_penalty \
        interface \
        isolation_mark \
        loglevel \
+       multicast_fanout \
        multicast_forceflood \
        multicast_mode \
        network_coding \
        orig_interval \
        routing_algo \
        multicast_forceflood \
        multicast_mode \
        network_coding \
        orig_interval \
        routing_algo \
+       throughput_override \
 
 config-tables := \
        backbonetable \
 
 config-tables := \
        backbonetable \
@@ -172,7 +177,6 @@ config-tables := \
 
 config-tools := \
        event \
 
 config-tools := \
        event \
-       log \
        ping \
        tcpdump \
        throughputmeter \
        ping \
        tcpdump \
        throughputmeter \
diff --git a/batctl/patches/0001-batctl-Make-vlan-setting-explicit.patch b/batctl/patches/0001-batctl-Make-vlan-setting-explicit.patch
new file mode 100644 (file)
index 0000000..e63c3dd
--- /dev/null
@@ -0,0 +1,324 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Thu, 13 Jun 2019 21:12:14 +0200
+Subject: batctl: Make vlan setting explicit
+
+The requirement to have a VLAN master device on top of the batadv mesh
+interface is artificially limiting the capabilities of batctl. Not all
+master devices in linux which register a VLAN are from type "vlan" and are
+only registering a single VLAN.
+
+For example VLAN aware bridges can create multiple VLANs. These require
+that the VLAN is identified using the VID and not the vlan device.
+
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+
+Forwarded: https://patchwork.open-mesh.org/patch/17947/
+
+diff --git a/ap_isolation.c b/ap_isolation.c
+index 71dcd00eac845d488c4969b17e1339f181c6c913..7c34649225dcc9cc557cc5bb4cbfa2343f8c0763 100644
+--- a/ap_isolation.c
++++ b/ap_isolation.c
+@@ -81,3 +81,8 @@ COMMAND_NAMED(SUBCOMMAND, ap_isolation, "ap", handle_sys_setting,
+             COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
+             &batctl_settings_ap_isolation,
+             "[0|1]             \tdisplay or modify ap_isolation setting");
++
++COMMAND_NAMED(SUBCOMMAND_VID, ap_isolation, "ap", handle_sys_setting,
++            COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
++            &batctl_settings_ap_isolation,
++            "[0|1]             \tdisplay or modify ap_isolation setting for vlan device or id");
+diff --git a/main.c b/main.c
+index 278683c6080e3ff4a9f3225931d0c5eb44f89595..6ca13ac0ec4c82ee969be04737a339fd702b52bd 100644
+--- a/main.c
++++ b/main.c
+@@ -28,48 +28,75 @@ extern const struct command *__stop___command[];
+ static void print_usage(void)
+ {
+-      enum command_type type[] = {
+-              SUBCOMMAND,
+-              DEBUGTABLE,
++      struct {
++              const char *label;
++              uint32_t types;
++      } type[] = {
++              {
++                      .label = "commands:\n",
++                      .types = BIT(SUBCOMMAND) |
++                               BIT(SUBCOMMAND_VID),
++              },
++              {
++                      .label = "debug tables:                                   \tdisplay the corresponding debug table\n",
++                      .types = BIT(DEBUGTABLE),
++              },
++      };
++      const char *default_prefixes[] = {
++              "",
++              NULL,
++      };
++      const char *vlan_prefixes[] = {
++              "vlan <vdev> ",
++              "vid <vid> ",
++              NULL,
+       };
+       const struct command **p;
+-      char buf[32];
++      const char **prefixes;
++      const char **prefix;
++      char buf[64];
+       size_t i;
+       fprintf(stderr, "Usage: batctl [options] command|debug table [parameters]\n");
+       fprintf(stderr, "options:\n");
+-      fprintf(stderr, " \t-m mesh interface or VLAN created on top of a mesh interface (default 'bat0')\n");
++      fprintf(stderr, " \t-m mesh interface (default 'bat0')\n");
+       fprintf(stderr, " \t-h print this help (or 'batctl <command|debug table> -h' for the parameter help)\n");
+       fprintf(stderr, " \t-v print version\n");
+       for (i = 0; i < sizeof(type) / sizeof(*type); i++) {
+               fprintf(stderr, "\n");
+-              switch (type[i]) {
+-              case SUBCOMMAND:
+-                      fprintf(stderr, "commands:\n");
+-                      break;
+-              case DEBUGTABLE:
+-                      fprintf(stderr, "debug tables:                                   \tdisplay the corresponding debug table\n");
+-                      break;
+-              }
++              fprintf(stderr, "%s", type[i].label);
+               for (p = __start___command; p < __stop___command; p++) {
+                       const struct command *cmd = *p;
+-                      if (cmd->type != type[i])
++                      if (!(BIT(cmd->type) & type[i].types))
+                               continue;
+                       if (!cmd->usage)
+                               continue;
+-                      if (strcmp(cmd->name, cmd->abbr) == 0)
+-                              snprintf(buf, sizeof(buf), "%s", cmd->name);
+-                      else
+-                              snprintf(buf, sizeof(buf), "%s|%s", cmd->name,
+-                                       cmd->abbr);
++                      switch (cmd->type) {
++                      case SUBCOMMAND_VID:
++                              prefixes = vlan_prefixes;
++                              break;
++                      default:
++                              prefixes = default_prefixes;
++                              break;
++                      }
+-                      fprintf(stderr, " \t%-27s%s\n", buf, cmd->usage);
++                      for (prefix = &prefixes[0]; *prefix; prefix++) {
++                              if (strcmp(cmd->name, cmd->abbr) == 0)
++                                      snprintf(buf, sizeof(buf), "%s%s",
++                                               *prefix, cmd->name);
++                              else
++                                      snprintf(buf, sizeof(buf), "%s%s|%s",
++                                               *prefix, cmd->name, cmd->abbr);
++
++                              fprintf(stderr, " \t%-35s%s\n", buf,
++                                      cmd->usage);
++                      }
+               }
+       }
+ }
+@@ -93,13 +120,19 @@ static void version(void)
+       exit(EXIT_SUCCESS);
+ }
+-static const struct command *find_command(const char *name)
++static const struct command *find_command(struct state *state, const char *name)
+ {
+       const struct command **p;
+       for (p = __start___command; p < __stop___command; p++) {
+               const struct command *cmd = *p;
++              if (state->vid >= 0 && cmd->type != SUBCOMMAND_VID)
++                      continue;
++
++              if (state->vid < 0 && cmd->type == SUBCOMMAND_VID)
++                      continue;
++
+               if (strcmp(cmd->name, name) == 0)
+                       return cmd;
+@@ -110,6 +143,51 @@ static const struct command *find_command(const char *name)
+       return NULL;
+ }
++static int parse_dev_args(struct state *state, int argc, char *argv[])
++{
++      unsigned long vid;
++      char *endptr;
++
++      /* not enough arguments to parse */
++      if (argc < 2) {
++              translate_mesh_iface(state);
++              return 0;
++      }
++
++      if (strcmp(argv[0], "vid") == 0) {
++              if (argv[1] == '\0') {
++                      fprintf(stderr, "Error - unparsable vid\n");
++                      return -EINVAL;
++              }
++
++              vid = strtoul(argv[1], &endptr, 0);
++              if (!endptr || *endptr != '\0') {
++                      fprintf(stderr, "Error - unparsable vid\n");
++                      return -EINVAL;
++              }
++
++              if (vid > 4095) {
++                      fprintf(stderr, "Error - too large vid (max 4095)\n");
++                      return -ERANGE;
++              }
++
++              /* get mesh interface and overwrite vid afterwards */
++              translate_mesh_iface(state);
++              state->vid = vid;
++
++              return 2;
++      } else if (strcmp(argv[0], "vlan") == 0) {
++              state->arg_iface = argv[1];
++              translate_mesh_iface(state);
++
++              return 2;
++      } else {
++              /* parse vlan as part of -m parameter */
++              translate_mesh_iface(state);
++              return 0;
++      }
++}
++
+ int main(int argc, char **argv)
+ {
+       const struct command *cmd;
+@@ -117,6 +195,7 @@ int main(int argc, char **argv)
+               .arg_iface = mesh_dfl_iface,
+               .cmd = NULL,
+       };
++      int dev_arguments;
+       int opt;
+       int ret;
+@@ -152,7 +231,15 @@ int main(int argc, char **argv)
+       argc -= optind;
+       optind = 0;
+-      cmd = find_command(argv[0]);
++      /* parse arguments to identify vlan, ... */
++      dev_arguments = parse_dev_args(&state, argc, argv);
++      if (dev_arguments < 0)
++              goto err;
++
++      argv += dev_arguments;
++      argc -= dev_arguments;
++
++      cmd = find_command(&state, argv[0]);
+       if (!cmd) {
+               fprintf(stderr,
+                       "Error - no valid command or debug table specified: %s\n",
+@@ -162,8 +249,6 @@ int main(int argc, char **argv)
+       state.cmd = cmd;
+-      translate_mesh_iface(&state);
+-
+       if (cmd->flags & COMMAND_FLAG_MESH_IFACE &&
+           check_mesh_iface(&state) < 0) {
+               fprintf(stderr,
+diff --git a/main.h b/main.h
+index 1a4701513c49ad8974b9c9189619f5dde622acd4..1d952610aefb8367bd52e24bea8c04c3d70b94ea 100644
+--- a/main.h
++++ b/main.h
+@@ -58,6 +58,7 @@ enum command_flags {
+ enum command_type {
+       SUBCOMMAND,
++      SUBCOMMAND_VID,
+       DEBUGTABLE,
+ };
+@@ -84,7 +85,7 @@ struct command {
+ };
+ #define COMMAND_NAMED(_type, _name, _abbr, _handler, _flags, _arg, _usage) \
+-      static const struct command command_ ## _name = { \
++      static const struct command command_ ## _name ## _ ## _type = { \
+               .type = (_type), \
+               .name = (#_name), \
+               .abbr = _abbr, \
+@@ -93,8 +94,8 @@ struct command {
+               .arg = (_arg), \
+               .usage = (_usage), \
+       }; \
+-      static const struct command *__command_ ## _name \
+-      __attribute__((__used__)) __attribute__ ((__section__ ("__command"))) = &command_ ## _name
++      static const struct command *__command_ ## _name ## _ ## _type \
++      __attribute__((__used__)) __attribute__ ((__section__ ("__command"))) = &command_ ## _name ## _ ## _type
+ #define COMMAND(_type, _handler, _abbr, _flags, _arg, _usage) \
+       COMMAND_NAMED(_type, _handler, _abbr, _handler, _flags, _arg, _usage)
+diff --git a/man/batctl.8 b/man/batctl.8
+index 0b430313075b5a7a4c796eba0867954e10061002..acb4288c4e6f59b322d20631ef8e3aee6f2215e5 100644
+--- a/man/batctl.8
++++ b/man/batctl.8
+@@ -68,7 +68,7 @@ free all attached interfaces and remove batman-adv interface.
+ If no parameter is given the current originator interval setting is displayed otherwise the parameter is used to set the
+ originator interval. The interval is in units of milliseconds.
+ .br
+-.IP "\fBap_isolation\fP|\fBap\fP [\fB0\fP|\fB1\fP]"
++.IP "[\fBvlan <vdev>\fP|\fBvid <vid>\fP] \fBap_isolation\fP|\fBap\fP [\fB0\fP|\fB1\fP]"
+ If no parameter is given the current ap isolation setting is displayed. Otherwise the parameter is used to enable or
+ disable ap isolation. This command can be used in conjunction with "\-m" option to target per VLAN configurations.
+ .br
+diff --git a/sys.c b/sys.c
+index 39123db87d391b8898b7454eba7708515bfb3c78..f19719cfad61f36f2a5c1078305de83eb5be142a 100644
+--- a/sys.c
++++ b/sys.c
+@@ -141,9 +141,35 @@ int sys_simple_print_boolean(struct nl_msg *msg, void *arg,
+ static void settings_usage(struct state *state)
+ {
+-      fprintf(stderr, "Usage: batctl [options] %s|%s [parameters] %s\n",
+-              state->cmd->name, state->cmd->abbr,
+-              state->cmd->usage ? state->cmd->usage : "");
++      const char *default_prefixes[] = {
++              "",
++              NULL,
++      };
++      const char *vlan_prefixes[] = {
++              "vlan <vdev> ",
++              "vid <vid> ",
++              NULL,
++      };
++      const char *linestart = "Usage:";
++      const char **prefixes;
++      const char **prefix;
++
++      switch (state->cmd->type) {
++      case SUBCOMMAND_VID:
++              prefixes = vlan_prefixes;
++              break;
++      default:
++              prefixes = default_prefixes;
++              break;
++      }
++
++      for (prefix = &prefixes[0]; *prefix; prefix++) {
++              fprintf(stderr, "%s batctl [options] %s%s|%s [parameters] %s\n",
++                      linestart, *prefix, state->cmd->name, state->cmd->abbr,
++                      state->cmd->usage ? state->cmd->usage : "");
++
++              linestart = "      ";
++      }
+       fprintf(stderr, "parameters:\n");
+       fprintf(stderr, " \t -h print this help\n");
diff --git a/batctl/patches/0002-batctl-Integrate-hardif-setting-framework.patch b/batctl/patches/0002-batctl-Integrate-hardif-setting-framework.patch
new file mode 100644 (file)
index 0000000..1224b5f
--- /dev/null
@@ -0,0 +1,183 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Thu, 13 Jun 2019 21:12:15 +0200
+Subject: batctl: Integrate hardif setting framework
+
+batctl currently supports settings which are either mesh interface or vlan
+specific. But B.A.T.M.A.N. V introduced two additional settings which are
+hard (slave) interface specific.
+
+To support these, an additional command prefix called hardif is implemented
+for some sysfs commands:
+
+  $ batctl -m bat0 hardif eth0 ...
+
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+
+Forwarded: https://patchwork.open-mesh.org/patch/17948/
+
+diff --git a/main.c b/main.c
+index 6ca13ac0ec4c82ee969be04737a339fd702b52bd..c806dbf4373fd082ff368cba391bdf14eebf4eae 100644
+--- a/main.c
++++ b/main.c
+@@ -35,7 +35,8 @@ static void print_usage(void)
+               {
+                       .label = "commands:\n",
+                       .types = BIT(SUBCOMMAND) |
+-                               BIT(SUBCOMMAND_VID),
++                               BIT(SUBCOMMAND_VID) |
++                               BIT(SUBCOMMAND_HIF),
+               },
+               {
+                       .label = "debug tables:                                   \tdisplay the corresponding debug table\n",
+@@ -51,6 +52,10 @@ static void print_usage(void)
+               "vid <vid> ",
+               NULL,
+       };
++      const char *hardif_prefixes[] = {
++              "hardif <netdev> ",
++              NULL,
++      };
+       const struct command **p;
+       const char **prefixes;
+       const char **prefix;
+@@ -81,6 +86,9 @@ static void print_usage(void)
+                       case SUBCOMMAND_VID:
+                               prefixes = vlan_prefixes;
+                               break;
++                      case SUBCOMMAND_HIF:
++                              prefixes = hardif_prefixes;
++                              break;
+                       default:
+                               prefixes = default_prefixes;
+                               break;
+@@ -133,6 +141,12 @@ static const struct command *find_command(struct state *state, const char *name)
+               if (state->vid < 0 && cmd->type == SUBCOMMAND_VID)
+                       continue;
++              if (state->hif > 0 && cmd->type != SUBCOMMAND_HIF)
++                      continue;
++
++              if (state->hif == 0 && cmd->type == SUBCOMMAND_HIF)
++                      continue;
++
+               if (strcmp(cmd->name, name) == 0)
+                       return cmd;
+@@ -180,6 +194,18 @@ static int parse_dev_args(struct state *state, int argc, char *argv[])
+               state->arg_iface = argv[1];
+               translate_mesh_iface(state);
++              return 2;
++      } else if (strcmp(argv[0], "hardif") == 0) {
++              state->hif = if_nametoindex(argv[1]);
++              if (state->hif == 0) {
++                      fprintf(stderr, "Error - hard interface not found\n");
++                      return -ENODEV;
++              }
++
++              snprintf(state->hard_iface, sizeof(state->hard_iface), "%s",
++                       argv[1]);
++
++              translate_mesh_iface(state);
+               return 2;
+       } else {
+               /* parse vlan as part of -m parameter */
+@@ -193,6 +219,7 @@ int main(int argc, char **argv)
+       const struct command *cmd;
+       struct state state = {
+               .arg_iface = mesh_dfl_iface,
++              .hif = 0,
+               .cmd = NULL,
+       };
+       int dev_arguments;
+diff --git a/main.h b/main.h
+index 1d952610aefb8367bd52e24bea8c04c3d70b94ea..a27d8486ef689206b27b1b50cb017b1b740e91c9 100644
+--- a/main.h
++++ b/main.h
+@@ -59,6 +59,7 @@ enum command_flags {
+ enum command_type {
+       SUBCOMMAND,
+       SUBCOMMAND_VID,
++      SUBCOMMAND_HIF,
+       DEBUGTABLE,
+ };
+@@ -66,6 +67,8 @@ struct state {
+       char *arg_iface;
+       char mesh_iface[IF_NAMESIZE];
+       unsigned int mesh_ifindex;
++      char hard_iface[IF_NAMESIZE];
++      unsigned int hif;
+       int vid;
+       const struct command *cmd;
+diff --git a/sys.c b/sys.c
+index f19719cfad61f36f2a5c1078305de83eb5be142a..fd34b2fa3bcf168a32bd53fc0df3f35d5532433f 100644
+--- a/sys.c
++++ b/sys.c
+@@ -150,6 +150,10 @@ static void settings_usage(struct state *state)
+               "vid <vid> ",
+               NULL,
+       };
++      const char *hardif_prefixes[] = {
++              "hardif <netdev> ",
++              NULL,
++      };
+       const char *linestart = "Usage:";
+       const char **prefixes;
+       const char **prefix;
+@@ -158,6 +162,9 @@ static void settings_usage(struct state *state)
+       case SUBCOMMAND_VID:
+               prefixes = vlan_prefixes;
+               break;
++      case SUBCOMMAND_HIF:
++              prefixes = hardif_prefixes;
++              break;
+       default:
+               prefixes = default_prefixes;
+               break;
+@@ -259,15 +266,23 @@ int handle_sys_setting(struct state *state, int argc, char **argv)
+               return EXIT_FAILURE;
+       }
+-      /* if the specified interface is a VLAN then change the path to point
+-       * to the proper "vlan%{vid}" subfolder in the sysfs tree.
+-       */
+-      if (state->vid >= 0)
++      if (state->hif > 0) {
++              /* if a hard interface was specified then change the path to
++               * point to the proper ${hardif}/batman-adv path in the sysfs
++               * tree.
++               */
++              snprintf(path_buff, PATH_BUFF_LEN, SYS_HARDIF_PATH,
++                       state->hard_iface);
++      } else if (state->vid >= 0) {
++              /* if the specified interface is a VLAN then change the path to
++               * point to the proper "vlan%{vid}" subfolder in the sysfs tree.
++               */
+               snprintf(path_buff, PATH_BUFF_LEN, SYS_VLAN_PATH,
+                        state->mesh_iface, state->vid);
+-      else
++      } else {
+               snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT,
+                        state->mesh_iface);
++      }
+       if (argc == 1) {
+               res = sys_read_setting(state, path_buff, settings->sysfs_name);
+diff --git a/sys.h b/sys.h
+index d4f2fcf542bc66b2b1c6ec55a9ac16e10fdc5cac..b6f0f9043a9af8e3c4d4f8bf7e4af4cab0aa5df9 100644
+--- a/sys.h
++++ b/sys.h
+@@ -21,8 +21,9 @@
+ #define SYS_BATIF_PATH_FMT    "/sys/class/net/%s/mesh/"
+ #define SYS_IFACE_PATH                "/sys/class/net"
+ #define SYS_IFACE_DIR         SYS_IFACE_PATH"/%s/"
+-#define SYS_MESH_IFACE_FMT    SYS_IFACE_PATH"/%s/batman_adv/mesh_iface"
+-#define SYS_IFACE_STATUS_FMT  SYS_IFACE_PATH"/%s/batman_adv/iface_status"
++#define SYS_HARDIF_PATH               SYS_IFACE_DIR "batman_adv/"
++#define SYS_MESH_IFACE_FMT    SYS_HARDIF_PATH "mesh_iface"
++#define SYS_IFACE_STATUS_FMT  SYS_HARDIF_PATH "iface_status"
+ #define SYS_VLAN_PATH         SYS_IFACE_PATH"/%s/mesh/vlan%d/"
+ #define SYS_ROUTING_ALGO_FMT  SYS_IFACE_PATH"/%s/mesh/routing_algo"
+ #define VLAN_ID_MAX_LEN               4
diff --git a/batctl/patches/0003-batctl-Add-elp_interval-setting-command.patch b/batctl/patches/0003-batctl-Add-elp_interval-setting-command.patch
new file mode 100644 (file)
index 0000000..bef7327
--- /dev/null
@@ -0,0 +1,183 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Thu, 13 Jun 2019 21:12:16 +0200
+Subject: batctl: Add elp_interval setting command
+
+B.A.T.M.A.N. V introduced a hard interface specific setting called
+elp_interval. It defines the interval in milliseconds in which batman-adv
+emits probing packets for neighbor sensing (ELP).
+
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+
+Forwarded: https://patchwork.open-mesh.org/patch/17949/
+
+diff --git a/Makefile b/Makefile
+index b7bd545e92963c62128efe60c0dc401bdd9fa023..f071da20f866bff6c162d697d2e43fa9d68ee08d 100755
+--- a/Makefile
++++ b/Makefile
+@@ -45,6 +45,7 @@ $(eval $(call add_command,bridge_loop_avoidance,y))
+ $(eval $(call add_command,claimtable,y))
+ $(eval $(call add_command,dat_cache,y))
+ $(eval $(call add_command,distributed_arp_table,y))
++$(eval $(call add_command,elp_interval,y))
+ $(eval $(call add_command,event,y))
+ $(eval $(call add_command,fragmentation,y))
+ $(eval $(call add_command,gateways,y))
+diff --git a/README.rst b/README.rst
+index bc54412bc77dae1889d4f05298c34efc1966776b..92983aa6030e2a890283bca448b9203cd4d56b51 100644
+--- a/README.rst
++++ b/README.rst
+@@ -386,6 +386,22 @@ Example::
+   1000
++batctl elp interval
++===================
++
++display or modify the elp interval in ms for hard interface
++
++Usage::
++
++  batctl hardif $hardif elp_interval|et [interval]
++
++Example::
++
++  $ batctl hardif eth0 elp_interval 200
++  $ batctl hardif eth0 elp_interval
++  200
++
++
+ batctl loglevel
+ ===============
+diff --git a/elp_interval.c b/elp_interval.c
+new file mode 100644
+index 0000000000000000000000000000000000000000..0a5e98923a622f52e523696b1ec1bfb856eeca9f
+--- /dev/null
++++ b/elp_interval.c
+@@ -0,0 +1,111 @@
++// SPDX-License-Identifier: GPL-2.0
++/* Copyright (C) 2009-2019  B.A.T.M.A.N. contributors:
++ *
++ * Marek Lindner <mareklindner@neomailbox.ch>
++ *
++ * License-Filename: LICENSES/preferred/GPL-2.0
++ */
++
++#include <errno.h>
++#include <stddef.h>
++#include <stdint.h>
++#include <string.h>
++
++#include "main.h"
++#include "sys.h"
++
++static struct elp_interval_data {
++      uint32_t elp_interval;
++} elp_interval;
++
++static int parse_elp_interval(struct state *state, int argc, char *argv[])
++{
++      struct settings_data *settings = state->cmd->arg;
++      struct elp_interval_data *data = settings->data;
++      char *endptr;
++
++      if (argc != 2) {
++              fprintf(stderr, "Error - incorrect number of arguments (expected 1)\n");
++              return -EINVAL;
++      }
++
++      data->elp_interval = strtoul(argv[1], &endptr, 0);
++      if (!endptr || *endptr != '\0') {
++              fprintf(stderr, "Error - the supplied argument is invalid: %s\n", argv[1]);
++              return -EINVAL;
++      }
++
++      return 0;
++}
++
++static int print_elp_interval(struct nl_msg *msg, void *arg)
++{
++      struct nlattr *attrs[BATADV_ATTR_MAX + 1];
++      struct nlmsghdr *nlh = nlmsg_hdr(msg);
++      struct genlmsghdr *ghdr;
++      int *result = arg;
++
++      if (!genlmsg_valid_hdr(nlh, 0))
++              return NL_OK;
++
++      ghdr = nlmsg_data(nlh);
++
++      if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
++                    genlmsg_len(ghdr), batadv_netlink_policy)) {
++              return NL_OK;
++      }
++
++      if (!attrs[BATADV_ATTR_ELP_INTERVAL])
++              return NL_OK;
++
++      printf("%u\n", nla_get_u32(attrs[BATADV_ATTR_ELP_INTERVAL]));
++
++      *result = 0;
++      return NL_STOP;
++}
++
++static int get_attrs_elp_interval(struct nl_msg *msg, void *arg)
++{
++      struct state *state = arg;
++
++      nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, state->hif);
++
++      return 0;
++}
++
++static int get_elp_interval(struct state *state)
++{
++      return sys_simple_nlquery(state, BATADV_CMD_GET_HARDIF,
++                                get_attrs_elp_interval, print_elp_interval);
++}
++
++static int set_attrs_elp_interval(struct nl_msg *msg, void *arg)
++{
++      struct state *state = arg;
++      struct settings_data *settings = state->cmd->arg;
++      struct elp_interval_data *data = settings->data;
++
++      nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, state->hif);
++      nla_put_u32(msg, BATADV_ATTR_ELP_INTERVAL, data->elp_interval);
++
++      return 0;
++}
++
++static int set_elp_interval(struct state *state)
++{
++      return sys_simple_nlquery(state, BATADV_CMD_SET_HARDIF,
++                                set_attrs_elp_interval, NULL);
++}
++
++static struct settings_data batctl_settings_elp_interval = {
++      .sysfs_name = "elp_interval",
++      .data = &elp_interval,
++      .parse = parse_elp_interval,
++      .netlink_get = get_elp_interval,
++      .netlink_set = set_elp_interval,
++};
++
++COMMAND_NAMED(SUBCOMMAND_HIF, elp_interval, "et", handle_sys_setting,
++            COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
++            &batctl_settings_elp_interval,
++            "[interval]        \tdisplay or modify elp_interval setting");
+diff --git a/man/batctl.8 b/man/batctl.8
+index acb4288c4e6f59b322d20631ef8e3aee6f2215e5..690da023fd1ac6f51915a9167e92030a650fe1bd 100644
+--- a/man/batctl.8
++++ b/man/batctl.8
+@@ -93,6 +93,10 @@ the bonding mode.
+ batctl will monitor for events from the netlink kernel interface of batman-adv. The local timestamp of the event will be printed
+ when parameter \fB\-t\fP is specified. Parameter \fB\-r\fP will do the same but with relative timestamps.
+ .br
++.IP "\fBhardif <hardif>\fP \fBelp_interval\fP|\fBet\fP [\fBinterval\fP]"
++If no parameter is given the current ELP interval setting of the hard interface is displayed otherwise the parameter is used to set the
++ELP interval. The interval is in units of milliseconds.
++.br
+ .IP "\fBfragmentation\fP|\fBf\fP [\fB0\fP|\fB1\fP]"
+ If no parameter is given the current fragmentation mode setting is displayed. Otherwise the parameter is used to enable or
+ disable fragmentation.
diff --git a/batctl/patches/0004-batctl-Add-throughput_override-setting-command.patch b/batctl/patches/0004-batctl-Add-throughput_override-setting-command.patch
new file mode 100644 (file)
index 0000000..7982cef
--- /dev/null
@@ -0,0 +1,189 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Thu, 13 Jun 2019 21:12:17 +0200
+Subject: batctl: Add throughput_override setting command
+
+B.A.T.M.A.N. V introduced a hard interface specific setting called
+throughput. It defines the throughput value to be used by B.A.T.M.A.N. V
+when estimating the link throughput using this interface. If the value is
+set to 0 then batman-adv will try to estimate the throughput by itself.
+
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+
+Forwarded: https://patchwork.open-mesh.org/patch/17950/
+
+diff --git a/Makefile b/Makefile
+index f071da20f866bff6c162d697d2e43fa9d68ee08d..e3747a2a28eb34323e34a1e22f5507dd1d7cd0f6 100755
+--- a/Makefile
++++ b/Makefile
+@@ -67,6 +67,7 @@ $(eval $(call add_command,ping,y))
+ $(eval $(call add_command,routing_algo,y))
+ $(eval $(call add_command,statistics,y))
+ $(eval $(call add_command,tcpdump,y))
++$(eval $(call add_command,throughput_override,y))
+ $(eval $(call add_command,throughputmeter,y))
+ $(eval $(call add_command,traceroute,y))
+ $(eval $(call add_command,transglobal,y))
+diff --git a/README.rst b/README.rst
+index 92983aa6030e2a890283bca448b9203cd4d56b51..128f539852fa085d023fb6d26ae436e76b617bb6 100644
+--- a/README.rst
++++ b/README.rst
+@@ -402,6 +402,23 @@ Example::
+   200
++batctl throughput override
++==========================
++
++display or modify the throughput override in kbit/s for hard interface
++
++Usage::
++
++  batctl hardif $hardif throughput_override|to [kbit]
++
++Example::
++
++  $ batctl hardif eth0 throughput_override 15000
++  $ batctl hardif eth0 throughput_override 15mbit
++  $ batctl hardif eth0 throughput_override
++  15.0 MBit
++
++
+ batctl loglevel
+ ===============
+diff --git a/man/batctl.8 b/man/batctl.8
+index 690da023fd1ac6f51915a9167e92030a650fe1bd..b8218963712bbf0cc9470459896fc904cd393748 100644
+--- a/man/batctl.8
++++ b/man/batctl.8
+@@ -203,6 +203,12 @@ supported routing algorithms are displayed.
+ Otherwise the parameter is used to select the routing algorithm for the following
+ batX interface to be created.
+ .br
++.IP "\fBhardif <hardif>\fP \fBthroughput_override|to\fP [\fBbandwidth\fP]\fP"
++If no parameter is given the current througput override is displayed otherwise
++the parameter is used to set the throughput override for the specified hard
++interface.
++Just enter any number (optionally followed by "kbit" or "mbit").
++.br
+ .IP "\fBisolation_mark\fP|\fBmark\fP"
+ If no parameter is given the current isolation mark value is displayed.
+ Otherwise the parameter is used to set or unset the isolation mark used by the
+diff --git a/throughput_override.c b/throughput_override.c
+new file mode 100644
+index 0000000000000000000000000000000000000000..28a6588b9417cca213ebde3545a3eb425592ad89
+--- /dev/null
++++ b/throughput_override.c
+@@ -0,0 +1,113 @@
++// SPDX-License-Identifier: GPL-2.0
++/* Copyright (C) 2009-2019  B.A.T.M.A.N. contributors:
++ *
++ * Marek Lindner <mareklindner@neomailbox.ch>
++ *
++ * License-Filename: LICENSES/preferred/GPL-2.0
++ */
++
++#include <errno.h>
++#include <stddef.h>
++#include <stdint.h>
++#include <string.h>
++
++#include "functions.h"
++#include "main.h"
++#include "sys.h"
++
++static struct throughput_override_data {
++      uint32_t throughput_override;
++} throughput_override;
++
++static int parse_throughput_override(struct state *state, int argc, char *argv[])
++{
++      struct settings_data *settings = state->cmd->arg;
++      struct throughput_override_data *data = settings->data;
++      bool ret;
++
++      if (argc != 2) {
++              fprintf(stderr, "Error - incorrect number of arguments (expected 1)\n");
++              return -EINVAL;
++      }
++
++      ret = parse_throughput(argv[1], "throughput override",
++                              &data->throughput_override);
++      if (!ret)
++              return -EINVAL;
++
++      return 0;
++}
++
++static int print_throughput_override(struct nl_msg *msg, void *arg)
++{
++      struct nlattr *attrs[BATADV_ATTR_MAX + 1];
++      struct nlmsghdr *nlh = nlmsg_hdr(msg);
++      struct genlmsghdr *ghdr;
++      int *result = arg;
++      uint32_t mbit;
++
++      if (!genlmsg_valid_hdr(nlh, 0))
++              return NL_OK;
++
++      ghdr = nlmsg_data(nlh);
++
++      if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
++                    genlmsg_len(ghdr), batadv_netlink_policy)) {
++              return NL_OK;
++      }
++
++      if (!attrs[BATADV_ATTR_THROUGHPUT_OVERRIDE])
++              return NL_OK;
++
++      mbit = nla_get_u32(attrs[BATADV_ATTR_THROUGHPUT_OVERRIDE]);
++      printf("%u.%u MBit\n", mbit / 10, mbit % 10);
++
++      *result = 0;
++      return NL_STOP;
++}
++
++static int get_attrs_elp_isolation(struct nl_msg *msg, void *arg)
++{
++      struct state *state = arg;
++
++      nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, state->hif);
++
++      return 0;
++}
++
++static int get_throughput_override(struct state *state)
++{
++      return sys_simple_nlquery(state, BATADV_CMD_GET_HARDIF,
++                                get_attrs_elp_isolation, print_throughput_override);
++}
++
++static int set_attrs_throughput_override(struct nl_msg *msg, void *arg)
++{
++      struct state *state = arg;
++      struct settings_data *settings = state->cmd->arg;
++      struct throughput_override_data *data = settings->data;
++
++      nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, state->hif);
++      nla_put_u32(msg, BATADV_ATTR_THROUGHPUT_OVERRIDE, data->throughput_override);
++
++      return 0;
++}
++
++static int set_throughput_override(struct state *state)
++{
++      return sys_simple_nlquery(state, BATADV_CMD_SET_HARDIF,
++                                set_attrs_throughput_override, NULL);
++}
++
++static struct settings_data batctl_settings_throughput_override = {
++      .sysfs_name = "throughput_override",
++      .data = &throughput_override,
++      .parse = parse_throughput_override,
++      .netlink_get = get_throughput_override,
++      .netlink_set = set_throughput_override,
++};
++
++COMMAND_NAMED(SUBCOMMAND_HIF, throughput_override, "to", handle_sys_setting,
++            COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
++            &batctl_settings_throughput_override,
++            "[mbit]        \tdisplay or modify throughput_override setting");
index 065302c..8995cdb 100644 (file)
@@ -2,18 +2,6 @@
 # Copyright (C) 2007-2019  B.A.T.M.A.N. contributors:
 #
 # Marek Lindner, Simon Wunderlich
 # Copyright (C) 2007-2019  B.A.T.M.A.N. contributors:
 #
 # Marek Lindner, Simon Wunderlich
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of version 2 of the GNU General Public
-# License as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #
 # B.A.T.M.A.N meshing protocol
 
 #
 # B.A.T.M.A.N meshing protocol
@@ -98,6 +86,18 @@ config BATMAN_ADV_DEBUG
          buffer. The output is controlled via the batadv netdev specific
          log_level setting.
 
          buffer. The output is controlled via the batadv netdev specific
          log_level setting.
 
+config BATMAN_ADV_SYSFS
+       bool "batman-adv sysfs entries"
+       depends on PACKAGE_kmod-batman-adv
+       default y
+       help
+         Say Y here if you want to enable batman-adv device configuration and
+         status interface through sysfs attributes. It is replaced by the
+         batadv generic netlink family but still used by various userspace
+         tools and scripts.
+
+         If unsure, say Y.
+
 config BATMAN_ADV_TRACING
        bool "B.A.T.M.A.N. tracing support"
        depends on PACKAGE_kmod-batman-adv
 config BATMAN_ADV_TRACING
        bool "B.A.T.M.A.N. tracing support"
        depends on PACKAGE_kmod-batman-adv
index d88b200..b84475a 100644 (file)
@@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=batman-adv
 
 
 PKG_NAME:=batman-adv
 
-PKG_VERSION:=2019.1
-PKG_RELEASE:=0
-PKG_HASH:=b99d605e06ca0c02e649b8910995f0b3a93145efb076f01ec0e2ac300cc1c5a9
+PKG_VERSION:=2019.2
+PKG_RELEASE:=3
+PKG_HASH:=70c3f6a6cf88d2b25681a76768a52ed92d9fe992ba8e358368b6a8088757adc8
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
@@ -59,6 +59,7 @@ PKG_EXTRA_KCONFIG:= \
        CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_BATMAN_ADV_MCAST),y,n) \
        CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_BATMAN_ADV_NC),y,n) \
        CONFIG_BATMAN_ADV_BATMAN_V=$(if $(CONFIG_BATMAN_ADV_BATMAN_V),y,n) \
        CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_BATMAN_ADV_MCAST),y,n) \
        CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_BATMAN_ADV_NC),y,n) \
        CONFIG_BATMAN_ADV_BATMAN_V=$(if $(CONFIG_BATMAN_ADV_BATMAN_V),y,n) \
+       CONFIG_BATMAN_ADV_SYSFS=$(if $(CONFIG_BATMAN_ADV_SYSFS),y,n) \
        CONFIG_BATMAN_ADV_TRACING=$(if $(CONFIG_BATMAN_ADV_TRACING),y,n) \
 
 PKG_EXTRA_CFLAGS:= \
        CONFIG_BATMAN_ADV_TRACING=$(if $(CONFIG_BATMAN_ADV_TRACING),y,n) \
 
 PKG_EXTRA_CFLAGS:= \
index eb8153c..a7fe63c 100755 (executable)
@@ -22,6 +22,7 @@ proto_batadv_init_config() {
        proto_config_add_int 'hop_penalty'
        proto_config_add_string 'isolation_mark'
        proto_config_add_string 'log_level'
        proto_config_add_int 'hop_penalty'
        proto_config_add_string 'isolation_mark'
        proto_config_add_string 'log_level'
+       proto_config_add_int 'multicast_fanout'
        proto_config_add_boolean 'multicast_mode:bool'
        proto_config_add_boolean 'network_coding:bool'
        proto_config_add_int 'orig_interval'
        proto_config_add_boolean 'multicast_mode:bool'
        proto_config_add_boolean 'network_coding:bool'
        proto_config_add_int 'orig_interval'
@@ -44,6 +45,7 @@ proto_batadv_setup() {
        local hop_penalty
        local isolation_mark
        local log_level
        local hop_penalty
        local isolation_mark
        local log_level
+       local multicast_fanout
        local multicast_mode
        local network_coding
        local orig_interval
        local multicast_mode
        local network_coding
        local orig_interval
@@ -61,6 +63,7 @@ proto_batadv_setup() {
        json_get_vars hop_penalty
        json_get_vars isolation_mark
        json_get_vars log_level
        json_get_vars hop_penalty
        json_get_vars isolation_mark
        json_get_vars log_level
+       json_get_vars multicast_fanout
        json_get_vars multicast_mode
        json_get_vars network_coding
        json_get_vars orig_interval
        json_get_vars multicast_mode
        json_get_vars network_coding
        json_get_vars orig_interval
@@ -100,6 +103,7 @@ proto_batadv_setup() {
 
        [ -n "$hop_penalty" ] && batctl -m "$iface" hop_penalty "$hop_penalty"
        [ -n "$isolation_mark" ] && batctl -m "$iface" isolation_mark "$isolation_mark"
 
        [ -n "$hop_penalty" ] && batctl -m "$iface" hop_penalty "$hop_penalty"
        [ -n "$isolation_mark" ] && batctl -m "$iface" isolation_mark "$isolation_mark"
+       [ -n "$multicast_fanout" ] && batctl -m "$iface" multicast_fanout "$multicast_fanout"
        [ -n "$multicast_mode" ] && batctl -m "$iface" multicast_mode "$multicast_mode" 2>&-
        [ -n "$network_coding" ] && batctl -m "$iface" network_coding "$network_coding" 2>&-
        [ -n "$log_level" ] && batctl -m "$iface" loglevel "$log_level" 2>&-
        [ -n "$multicast_mode" ] && batctl -m "$iface" multicast_mode "$multicast_mode" 2>&-
        [ -n "$network_coding" ] && batctl -m "$iface" network_coding "$network_coding" 2>&-
        [ -n "$log_level" ] && batctl -m "$iface" loglevel "$log_level" 2>&-
index 9283d2b..76ccd81 100755 (executable)
@@ -7,21 +7,30 @@
 }
 
 proto_batadv_hardif_init_config() {
 }
 
 proto_batadv_hardif_init_config() {
+       proto_config_add_int 'elp_interval'
        proto_config_add_string "master"
        proto_config_add_string "master"
+       proto_config_add_string 'throughput_override'
 }
 
 proto_batadv_hardif_setup() {
        local config="$1"
        local iface="$2"
 
 }
 
 proto_batadv_hardif_setup() {
        local config="$1"
        local iface="$2"
 
+       local elp_interval
        local master
        local master
+       local throughput_override
 
 
+       json_get_vars elp_interval
        json_get_vars master
        json_get_vars master
+       json_get_vars throughput_override
 
        ( proto_add_host_dependency "$config" '' "$master" )
 
        batctl -m "$master" interface -M add "$iface"
 
 
        ( proto_add_host_dependency "$config" '' "$master" )
 
        batctl -m "$master" interface -M add "$iface"
 
+       [ -n "$elp_interval" ] && batctl -m "$master" hardif "$iface" elp_interval "$elp_interval"
+       [ -n "$throughput_override" ] && batctl -m "$master" hardif "$iface" throughput_override "$throughput_override"
+
        proto_init_update "$iface" 1
        proto_send_update "$config"
 }
        proto_init_update "$iface" 1
        proto_send_update "$config"
 }
index d6d00ad..b4835f6 100755 (executable)
@@ -5,7 +5,7 @@
 init_proto "$@"
 
 proto_batadv_vlan_init_config() {
 init_proto "$@"
 
 proto_batadv_vlan_init_config() {
-       proto_config_add_string "ap_isolation"
+       proto_config_add_boolean 'ap_isolation:bool'
 }
 
 proto_batadv_vlan_setup() {
 }
 
 proto_batadv_vlan_setup() {
@@ -17,7 +17,7 @@ proto_batadv_vlan_setup() {
 
        json_get_vars ap_isolation
 
 
        json_get_vars ap_isolation
 
-       batctl -m "$iface" ap_isolation "$ap_isolation"
+       [ -n "$ap_isolation" ] && batctl -m "$iface" ap_isolation "$ap_isolation"
        proto_init_update "$iface" 1
        proto_send_update "$config"
 }
        proto_init_update "$iface" 1
        proto_send_update "$config"
 }
diff --git a/batman-adv/patches/0001-Revert-batman-adv-convert-stream-like-files-from-non.patch b/batman-adv/patches/0001-Revert-batman-adv-convert-stream-like-files-from-non.patch
new file mode 100644 (file)
index 0000000..201e327
--- /dev/null
@@ -0,0 +1,55 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Thu, 23 May 2019 19:26:27 +0200
+Subject: Revert "batman-adv: convert stream-like files from nonseekable_open -> stream_open"
+
+OpenWrt's mac80211 package is not yet ready to support the generic netlink
+API of Linux 5.2.
+
+This reverts commit 337ae19a00d4455cf84afa58abfb432f78c882b9.
+
+diff --git a/compat-include/linux/fs.h b/compat-include/linux/fs.h
+index 480722f04ba7ddefc837d5e55a340271e0814b14..c52e0e8e87584d106ab64ef2c522e6ac1ff6e796 100644
+--- a/compat-include/linux/fs.h
++++ b/compat-include/linux/fs.h
+@@ -31,15 +31,4 @@ static inline struct dentry *batadv_file_dentry(const struct file *file)
+ #endif /* < KERNEL_VERSION(4, 6, 0) */
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+-
+-static inline int batadv_stream_open(struct inode *inode, struct file *filp)
+-{
+-      return nonseekable_open(inode, filp);
+-}
+-
+-#define stream_open batadv_stream_open
+-
+-#endif /* < KERNEL_VERSION(5, 2, 0) */
+-
+ #endif        /* _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_ */
+diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
+index 0a91c8661357d4ddbea1ba20dcd0df67b8ba5a97..de81b5ecad91afd8d684edbf781c70a3bae38c60 100644
+--- a/net/batman-adv/icmp_socket.c
++++ b/net/batman-adv/icmp_socket.c
+@@ -65,7 +65,7 @@ static int batadv_socket_open(struct inode *inode, struct file *file)
+       batadv_debugfs_deprecated(file, "");
+-      stream_open(inode, file);
++      nonseekable_open(inode, file);
+       socket_client = kmalloc(sizeof(*socket_client), GFP_KERNEL);
+       if (!socket_client) {
+diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c
+index f79ebd5b46e95b3b6de717c7ea1ecf44e5c96051..60ce11e16a905e790424a2d7aca81c1f945c1ec2 100644
+--- a/net/batman-adv/log.c
++++ b/net/batman-adv/log.c
+@@ -90,7 +90,7 @@ static int batadv_log_open(struct inode *inode, struct file *file)
+       batadv_debugfs_deprecated(file,
+                                 "Use tracepoint batadv:batadv_dbg instead\n");
+-      stream_open(inode, file);
++      nonseekable_open(inode, file);
+       file->private_data = inode->i_private;
+       return 0;
+ }
diff --git a/batman-adv/patches/0002-Revert-batman-adv-compat-Drop-support-for-genl_ops-s.patch b/batman-adv/patches/0002-Revert-batman-adv-compat-Drop-support-for-genl_ops-s.patch
new file mode 100644 (file)
index 0000000..e3b7dec
--- /dev/null
@@ -0,0 +1,29 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Thu, 23 May 2019 19:26:36 +0200
+Subject: Revert "batman-adv: compat: Drop support for genl_ops->start"
+
+OpenWrt's mac80211 package is not yet ready to support the generic netlink
+API of Linux 5.2.
+
+This reverts commit 1d30dbe3917d0d6fdb8ba473dfdd6265ac46670b.
+
+diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h
+index ee5b82288be97193c1a8e8340a2ea7e0c7ce112c..fbfdb733a3dd63c251def43cae416c7fe32cadab 100644
+--- a/compat-include/net/genetlink.h
++++ b/compat-include/net/genetlink.h
+@@ -42,6 +42,7 @@ enum genl_validate_flags {
+ struct batadv_genl_ops {
+       int                    (*doit)(struct sk_buff *skb,
+                                      struct genl_info *info);
++      int                    (*start)(struct netlink_callback *cb);
+       int                    (*dumpit)(struct sk_buff *skb,
+                                        struct netlink_callback *cb);
+       int                    (*done)(struct netlink_callback *cb);
+@@ -104,6 +105,7 @@ static inline int batadv_genl_register_family(struct batadv_genl_family *family)
+       for (i = 0; i < family->family.n_ops; i++) {
+               ops[i].doit = family->ops[i].doit;
++              ops[i].start = family->ops[i].start;
+               ops[i].dumpit = family->ops[i].dumpit;
+               ops[i].done = family->ops[i].done;
+               ops[i].cmd = family->ops[i].cmd;
diff --git a/batman-adv/patches/0003-Revert-batman-adv-genetlink-optionally-validate-stri.patch b/batman-adv/patches/0003-Revert-batman-adv-genetlink-optionally-validate-stri.patch
new file mode 100644 (file)
index 0000000..c383c69
--- /dev/null
@@ -0,0 +1,222 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Thu, 23 May 2019 19:26:45 +0200
+Subject: Revert "batman-adv: genetlink: optionally validate strictly/dumps"
+
+OpenWrt's mac80211 package is not yet ready to support the generic netlink
+API of Linux 5.2.
+
+This reverts commit 2ee47abaeb35ca62bb909830e10b0e973393b853.
+
+diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h
+index fbfdb733a3dd63c251def43cae416c7fe32cadab..7d17a705273650355f074788e9220fc4981b0db1 100644
+--- a/compat-include/net/genetlink.h
++++ b/compat-include/net/genetlink.h
+@@ -33,25 +33,6 @@ void batadv_genl_dump_check_consistent(struct netlink_callback *cb,
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+-enum genl_validate_flags {
+-      GENL_DONT_VALIDATE_STRICT               = BIT(0),
+-      GENL_DONT_VALIDATE_DUMP                 = BIT(1),
+-      GENL_DONT_VALIDATE_DUMP_STRICT          = BIT(2),
+-};
+-
+-struct batadv_genl_ops {
+-      int                    (*doit)(struct sk_buff *skb,
+-                                     struct genl_info *info);
+-      int                    (*start)(struct netlink_callback *cb);
+-      int                    (*dumpit)(struct sk_buff *skb,
+-                                       struct netlink_callback *cb);
+-      int                    (*done)(struct netlink_callback *cb);
+-      u8                      cmd;
+-      u8                      internal_flags;
+-      u8                      flags;
+-      u8                      validate;
+-};
+-
+ struct batadv_genl_family {
+       /* data handled by the actual kernel */
+       struct genl_family family;
+@@ -69,7 +50,7 @@ struct batadv_genl_family {
+                        struct genl_info *info);
+         void (*post_doit)(const struct genl_ops *ops, struct sk_buff *skb,
+                         struct genl_info *info);
+-      const struct batadv_genl_ops *ops;
++      const struct genl_ops *ops;
+       const struct genl_multicast_group *mcgrps;
+       unsigned int n_ops;
+       unsigned int n_mcgrps;
+@@ -82,6 +63,8 @@ struct batadv_genl_family {
+       struct genl_ops *copy_ops;
+ };
++#define genl_family batadv_genl_family
++
+ static inline int batadv_genl_register_family(struct batadv_genl_family *family)
+ {
+       struct genl_ops *ops;
+@@ -99,20 +82,12 @@ static inline int batadv_genl_register_family(struct batadv_genl_family *family)
+       family->family.n_mcgrps = family->n_mcgrps;
+       family->family.module = family->module;
+-      ops = kzalloc(sizeof(*ops) * family->n_ops, GFP_KERNEL);
++      ops = kmemdup(family->ops, sizeof(*ops) * family->n_ops, GFP_KERNEL);
+       if (!ops)
+               return -ENOMEM;
+-      for (i = 0; i < family->family.n_ops; i++) {
+-              ops[i].doit = family->ops[i].doit;
+-              ops[i].start = family->ops[i].start;
+-              ops[i].dumpit = family->ops[i].dumpit;
+-              ops[i].done = family->ops[i].done;
+-              ops[i].cmd = family->ops[i].cmd;
+-              ops[i].internal_flags = family->ops[i].internal_flags;
+-              ops[i].flags = family->ops[i].flags;
++      for (i = 0; i < family->family.n_ops; i++)
+               ops[i].policy = family->policy;
+-      }
+       family->family.ops = ops;
+       family->copy_ops = ops;
+@@ -120,17 +95,6 @@ static inline int batadv_genl_register_family(struct batadv_genl_family *family)
+       return genl_register_family(&family->family);
+ }
+-typedef struct genl_ops batadv_genl_ops_old;
+-
+-#define batadv_pre_doit(__x, __y, __z) \
+-      batadv_pre_doit(const batadv_genl_ops_old *ops, __y, __z)
+-
+-#define batadv_post_doit(__x, __y, __z) \
+-      batadv_post_doit(const batadv_genl_ops_old *ops, __y, __z)
+-
+-#define genl_ops batadv_genl_ops
+-#define genl_family batadv_genl_family
+-
+ #define genl_register_family(family) \
+       batadv_genl_register_family((family))
+diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
+index a67720fad46ca496c932c0306e2f7ec4ed496fc9..e7907308b331ddc3e4917ff7d648bca27a65536b 100644
+--- a/net/batman-adv/netlink.c
++++ b/net/batman-adv/netlink.c
+@@ -1343,34 +1343,29 @@ static void batadv_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
+ static const struct genl_ops batadv_netlink_ops[] = {
+       {
+               .cmd = BATADV_CMD_GET_MESH,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               /* can be retrieved by unprivileged users */
+               .doit = batadv_netlink_get_mesh,
+               .internal_flags = BATADV_FLAG_NEED_MESH,
+       },
+       {
+               .cmd = BATADV_CMD_TP_METER,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .doit = batadv_netlink_tp_meter_start,
+               .internal_flags = BATADV_FLAG_NEED_MESH,
+       },
+       {
+               .cmd = BATADV_CMD_TP_METER_CANCEL,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .doit = batadv_netlink_tp_meter_cancel,
+               .internal_flags = BATADV_FLAG_NEED_MESH,
+       },
+       {
+               .cmd = BATADV_CMD_GET_ROUTING_ALGOS,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_algo_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_HARDIF,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               /* can be retrieved by unprivileged users */
+               .dumpit = batadv_netlink_dump_hardif,
+               .doit = batadv_netlink_get_hardif,
+@@ -1379,68 +1374,57 @@ static const struct genl_ops batadv_netlink_ops[] = {
+       },
+       {
+               .cmd = BATADV_CMD_GET_TRANSTABLE_LOCAL,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_tt_local_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_TRANSTABLE_GLOBAL,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_tt_global_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_ORIGINATORS,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_orig_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_NEIGHBORS,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_hardif_neigh_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_GATEWAYS,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_gw_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_BLA_CLAIM,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_bla_claim_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_BLA_BACKBONE,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_bla_backbone_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_DAT_CACHE,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_dat_cache_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_MCAST_FLAGS,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .dumpit = batadv_mcast_flags_dump,
+       },
+       {
+               .cmd = BATADV_CMD_SET_MESH,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .doit = batadv_netlink_set_mesh,
+               .internal_flags = BATADV_FLAG_NEED_MESH,
+       },
+       {
+               .cmd = BATADV_CMD_SET_HARDIF,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .doit = batadv_netlink_set_hardif,
+               .internal_flags = BATADV_FLAG_NEED_MESH |
+@@ -1448,7 +1432,6 @@ static const struct genl_ops batadv_netlink_ops[] = {
+       },
+       {
+               .cmd = BATADV_CMD_GET_VLAN,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               /* can be retrieved by unprivileged users */
+               .doit = batadv_netlink_get_vlan,
+               .internal_flags = BATADV_FLAG_NEED_MESH |
+@@ -1456,7 +1439,6 @@ static const struct genl_ops batadv_netlink_ops[] = {
+       },
+       {
+               .cmd = BATADV_CMD_SET_VLAN,
+-              .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+               .flags = GENL_ADMIN_PERM,
+               .doit = batadv_netlink_set_vlan,
+               .internal_flags = BATADV_FLAG_NEED_MESH |
diff --git a/batman-adv/patches/0004-Revert-batman-adv-genetlink-make-policy-common-to-fa.patch b/batman-adv/patches/0004-Revert-batman-adv-genetlink-make-policy-common-to-fa.patch
new file mode 100644 (file)
index 0000000..a5814e7
--- /dev/null
@@ -0,0 +1,256 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Thu, 23 May 2019 19:26:58 +0200
+Subject: Revert "batman-adv: genetlink: make policy common to family"
+
+OpenWrt's mac80211 package is not yet ready to support the generic netlink
+API of Linux 5.2.
+
+This reverts commit acfc9a214d01695d1676313ca80cfd2d9309f633.
+
+diff --git a/compat-include/linux/cache.h b/compat-include/linux/cache.h
+index 9ddda31232ed4b58efcb57dc2ee99ae82d09d6e2..efe440d11d04a1c3999649ba52058ad82e4d6bea 100644
+--- a/compat-include/linux/cache.h
++++ b/compat-include/linux/cache.h
+@@ -13,8 +13,12 @@
+ #include <linux/version.h>
+ #include_next <linux/cache.h>
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
++/* hack for netlink.c which marked the family ops as ro */
++#ifdef __ro_after_init
++#undef __ro_after_init
++#endif
+ #define __ro_after_init
+ #endif /* < KERNEL_VERSION(4, 6, 0) */
+diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h
+index 7d17a705273650355f074788e9220fc4981b0db1..58fc24d7147a7f79c2db1976b36351d294f2aa4c 100644
+--- a/compat-include/net/genetlink.h
++++ b/compat-include/net/genetlink.h
+@@ -30,92 +30,4 @@ void batadv_genl_dump_check_consistent(struct netlink_callback *cb,
+ #endif /* < KERNEL_VERSION(4, 15, 0) */
+-
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
+-
+-struct batadv_genl_family {
+-      /* data handled by the actual kernel */
+-      struct genl_family family;
+-
+-      /* data which has to be copied to family by
+-       * batadv_genl_register_family
+-       */
+-      unsigned int hdrsize;
+-      char name[GENL_NAMSIZ];
+-      unsigned int version;
+-      unsigned int maxattr;
+-      const struct nla_policy *policy;
+-      bool netnsok;
+-        int  (*pre_doit)(const struct genl_ops *ops, struct sk_buff *skb,
+-                       struct genl_info *info);
+-        void (*post_doit)(const struct genl_ops *ops, struct sk_buff *skb,
+-                        struct genl_info *info);
+-      const struct genl_ops *ops;
+-      const struct genl_multicast_group *mcgrps;
+-      unsigned int n_ops;
+-      unsigned int n_mcgrps;
+-      struct module *module;
+-
+-      /* allocated by batadv_genl_register_family and free'd by
+-       * batadv_genl_unregister_family. Used to modify the usually read-only
+-       * ops
+-       */
+-      struct genl_ops *copy_ops;
+-};
+-
+-#define genl_family batadv_genl_family
+-
+-static inline int batadv_genl_register_family(struct batadv_genl_family *family)
+-{
+-      struct genl_ops *ops;
+-      unsigned int i;
+-
+-      family->family.hdrsize = family->hdrsize;
+-      strncpy(family->family.name, family->name, sizeof(family->family.name));
+-      family->family.version = family->version;
+-      family->family.maxattr = family->maxattr;
+-      family->family.netnsok = family->netnsok;
+-      family->family.pre_doit = family->pre_doit;
+-      family->family.post_doit = family->post_doit;
+-      family->family.mcgrps = family->mcgrps;
+-      family->family.n_ops = family->n_ops;
+-      family->family.n_mcgrps = family->n_mcgrps;
+-      family->family.module = family->module;
+-
+-      ops = kmemdup(family->ops, sizeof(*ops) * family->n_ops, GFP_KERNEL);
+-      if (!ops)
+-              return -ENOMEM;
+-
+-      for (i = 0; i < family->family.n_ops; i++)
+-              ops[i].policy = family->policy;
+-
+-      family->family.ops = ops;
+-      family->copy_ops = ops;
+-
+-      return genl_register_family(&family->family);
+-}
+-
+-#define genl_register_family(family) \
+-      batadv_genl_register_family((family))
+-
+-static inline void
+-batadv_genl_unregister_family(struct batadv_genl_family *family)
+-{
+-
+-      genl_unregister_family(&family->family);
+-      kfree(family->copy_ops);
+-}
+-
+-#define genl_unregister_family(family) \
+-      batadv_genl_unregister_family((family))
+-
+-#define genlmsg_put(_skb, _pid, _seq, _family, _flags, _cmd) \
+-      genlmsg_put(_skb, _pid, _seq, &(_family)->family, _flags, _cmd)
+-
+-#define genlmsg_multicast_netns(_family, _net, _skb, _portid, _group, _flags) \
+-      genlmsg_multicast_netns(&(_family)->family, _net, _skb, _portid, \
+-                              _group, _flags)
+-
+-#endif /* < KERNEL_VERSION(5, 2, 0) */
+-
+ #endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */
+diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
+index e7907308b331ddc3e4917ff7d648bca27a65536b..daf56933223d478399c63360203bcf283d7686a3 100644
+--- a/net/batman-adv/netlink.c
++++ b/net/batman-adv/netlink.c
+@@ -1344,29 +1344,34 @@ static const struct genl_ops batadv_netlink_ops[] = {
+       {
+               .cmd = BATADV_CMD_GET_MESH,
+               /* can be retrieved by unprivileged users */
++              .policy = batadv_netlink_policy,
+               .doit = batadv_netlink_get_mesh,
+               .internal_flags = BATADV_FLAG_NEED_MESH,
+       },
+       {
+               .cmd = BATADV_CMD_TP_METER,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .doit = batadv_netlink_tp_meter_start,
+               .internal_flags = BATADV_FLAG_NEED_MESH,
+       },
+       {
+               .cmd = BATADV_CMD_TP_METER_CANCEL,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .doit = batadv_netlink_tp_meter_cancel,
+               .internal_flags = BATADV_FLAG_NEED_MESH,
+       },
+       {
+               .cmd = BATADV_CMD_GET_ROUTING_ALGOS,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_algo_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_HARDIF,
+               /* can be retrieved by unprivileged users */
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_netlink_dump_hardif,
+               .doit = batadv_netlink_get_hardif,
+               .internal_flags = BATADV_FLAG_NEED_MESH |
+@@ -1375,57 +1380,68 @@ static const struct genl_ops batadv_netlink_ops[] = {
+       {
+               .cmd = BATADV_CMD_GET_TRANSTABLE_LOCAL,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_tt_local_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_TRANSTABLE_GLOBAL,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_tt_global_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_ORIGINATORS,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_orig_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_NEIGHBORS,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_hardif_neigh_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_GATEWAYS,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_gw_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_BLA_CLAIM,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_bla_claim_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_BLA_BACKBONE,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_bla_backbone_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_DAT_CACHE,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_dat_cache_dump,
+       },
+       {
+               .cmd = BATADV_CMD_GET_MCAST_FLAGS,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .dumpit = batadv_mcast_flags_dump,
+       },
+       {
+               .cmd = BATADV_CMD_SET_MESH,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .doit = batadv_netlink_set_mesh,
+               .internal_flags = BATADV_FLAG_NEED_MESH,
+       },
+       {
+               .cmd = BATADV_CMD_SET_HARDIF,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .doit = batadv_netlink_set_hardif,
+               .internal_flags = BATADV_FLAG_NEED_MESH |
+                                 BATADV_FLAG_NEED_HARDIF,
+@@ -1433,6 +1449,7 @@ static const struct genl_ops batadv_netlink_ops[] = {
+       {
+               .cmd = BATADV_CMD_GET_VLAN,
+               /* can be retrieved by unprivileged users */
++              .policy = batadv_netlink_policy,
+               .doit = batadv_netlink_get_vlan,
+               .internal_flags = BATADV_FLAG_NEED_MESH |
+                                 BATADV_FLAG_NEED_VLAN,
+@@ -1440,6 +1457,7 @@ static const struct genl_ops batadv_netlink_ops[] = {
+       {
+               .cmd = BATADV_CMD_SET_VLAN,
+               .flags = GENL_ADMIN_PERM,
++              .policy = batadv_netlink_policy,
+               .doit = batadv_netlink_set_vlan,
+               .internal_flags = BATADV_FLAG_NEED_MESH |
+                                 BATADV_FLAG_NEED_VLAN,
+@@ -1451,7 +1469,6 @@ struct genl_family batadv_netlink_family __ro_after_init = {
+       .name = BATADV_NL_NAME,
+       .version = 1,
+       .maxattr = BATADV_ATTR_MAX,
+-      .policy = batadv_netlink_policy,
+       .netnsok = true,
+       .pre_doit = batadv_pre_doit,
+       .post_doit = batadv_post_doit,
diff --git a/batman-adv/patches/0005-batman-adv-Fix-duplicated-OGMs-on-NETDEV_UP.patch b/batman-adv/patches/0005-batman-adv-Fix-duplicated-OGMs-on-NETDEV_UP.patch
new file mode 100644 (file)
index 0000000..2fc0e19
--- /dev/null
@@ -0,0 +1,77 @@
+From: Sven Eckelmann <sven@narfation.org>
+Date: Sun, 2 Jun 2019 10:57:31 +0200
+Subject: batman-adv: Fix duplicated OGMs on NETDEV_UP
+
+The state of slave interfaces are handled differently depending on whether
+the interface is up or not. All active interfaces (IFF_UP) will transmit
+OGMs. But for B.A.T.M.A.N. IV, also non-active interfaces are scheduling
+(low TTL) OGMs on active interfaces. The code which setups and schedules
+the OGMs must therefore already be called when the interfaces gets added as
+slave interface and the transmit function must then check whether it has to
+send out the OGM or not on the specific slave interface.
+
+But the commit 0d8468553c3c ("batman-adv: remove ogm_emit and ogm_schedule
+API calls") moved the setup code from the enable function to the activate
+function. The latter is called either when the added slave was already up
+when batadv_hardif_enable_interface processed the new interface or when a
+NETDEV_UP event was received for this slave interfac. As result, each
+NETDEV_UP would schedule a new OGM worker for the interface and thus OGMs
+would be send a lot more than expected.
+
+Fixes: 0d8468553c3c ("batman-adv: remove ogm_emit and ogm_schedule API calls")
+Reported-by: Linus Lüssing <linus.luessing@c0d3.blue>
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+
+Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/c92331e0df3c0c5645ee5a897eb018c5da5e4aa5
+
+diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
+index bd4138ddf7e09a0020d9842d603dc98f21e225c7..240ed70912d6a014c0a48280741989133034396c 100644
+--- a/net/batman-adv/bat_iv_ogm.c
++++ b/net/batman-adv/bat_iv_ogm.c
+@@ -2337,7 +2337,7 @@ batadv_iv_ogm_neigh_is_sob(struct batadv_neigh_node *neigh1,
+       return ret;
+ }
+-static void batadv_iv_iface_activate(struct batadv_hard_iface *hard_iface)
++static void batadv_iv_iface_enabled(struct batadv_hard_iface *hard_iface)
+ {
+       /* begin scheduling originator messages on that interface */
+       batadv_iv_ogm_schedule(hard_iface);
+@@ -2683,8 +2683,8 @@ static void batadv_iv_gw_dump(struct sk_buff *msg, struct netlink_callback *cb,
+ static struct batadv_algo_ops batadv_batman_iv __read_mostly = {
+       .name = "BATMAN_IV",
+       .iface = {
+-              .activate = batadv_iv_iface_activate,
+               .enable = batadv_iv_ogm_iface_enable,
++              .enabled = batadv_iv_iface_enabled,
+               .disable = batadv_iv_ogm_iface_disable,
+               .update_mac = batadv_iv_ogm_iface_update_mac,
+               .primary_set = batadv_iv_ogm_primary_iface_set,
+diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
+index 79d1731b83066c60f9aef958d2bc343233bce67a..3719cfd026f04093f5d86ffe1b41a41849b2af62 100644
+--- a/net/batman-adv/hard-interface.c
++++ b/net/batman-adv/hard-interface.c
+@@ -795,6 +795,9 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
+       batadv_hardif_recalc_extra_skbroom(soft_iface);
++      if (bat_priv->algo_ops->iface.enabled)
++              bat_priv->algo_ops->iface.enabled(hard_iface);
++
+ out:
+       return 0;
+diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
+index 74b644738a36bfe063eef6df016278b45a1a0256..e0b25104cbfa9f715df364658621c29faa7ad637 100644
+--- a/net/batman-adv/types.h
++++ b/net/batman-adv/types.h
+@@ -2129,6 +2129,9 @@ struct batadv_algo_iface_ops {
+       /** @enable: init routing info when hard-interface is enabled */
+       int (*enable)(struct batadv_hard_iface *hard_iface);
++      /** @enabled: notification when hard-interface was enabled (optional) */
++      void (*enabled)(struct batadv_hard_iface *hard_iface);
++
+       /** @disable: de-init routing info when hard-interface is disabled */
+       void (*disable)(struct batadv_hard_iface *hard_iface);
index 425d355..77497ab 100644 (file)
@@ -79,7 +79,7 @@ MAKE_BATGAT_ARGS += \
        PATH="$(TARGET_PATH)" \
        SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
        LINUX_VERSION="$(LINUX_VERSION)" \
        PATH="$(TARGET_PATH)" \
        SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
        LINUX_VERSION="$(LINUX_VERSION)" \
-       REVISION="$(PKG_REV)" modules   
+       REVISION="$(PKG_REV)" modules
 
 
 define Build/Configure
 
 
 define Build/Configure
@@ -88,11 +88,11 @@ endef
 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),)
        BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_BATMAND_ARGS)
 endif
 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),)
        BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_BATMAND_ARGS)
 endif
-       
+
 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),)
        BUILD_BATGAT := $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATGAT_ARGS)
 endif
 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),)
        BUILD_BATGAT := $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATGAT_ARGS)
 endif
-               
+
 define Build/Compile
        $(BUILD_BATMAND)
        cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
 define Build/Compile
        $(BUILD_BATMAND)
        cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
index 6d1f3be..0cad38d 100644 (file)
@@ -1,12 +1,11 @@
 config batmand general
        option interface                ath0
 config batmand general
        option interface                ath0
-       option hna                      
-       option gateway_class            
+       option hna
+       option gateway_class
        option originator_interval
        option originator_interval
-       option preferred_gateway        
+       option preferred_gateway
        option routing_class
        option visualisation_srv
        option policy_routing_script
        option disable_client_nat
        option disable_aggregation
        option routing_class
        option visualisation_srv
        option policy_routing_script
        option disable_client_nat
        option disable_aggregation
-       
index 403e9f3..add4ec8 100644 (file)
@@ -18,10 +18,9 @@ start () {
        disable_aggregation=$(uci get batmand.general.disable_aggregation)
        batman_args=""
 
        disable_aggregation=$(uci get batmand.general.disable_aggregation)
        batman_args=""
 
-       for hna in $hnas
-          do
-             batman_args=${batman_args}'-a '$hna' '
-          done
+       for hna in $hnas; do
+               batman_args=${batman_args}'-a '$hna' '
+       done
 
        if [ $gateway_class ]; then
                batman_args=${batman_args}'-g '$gateway_class' '
 
        if [ $gateway_class ]; then
                batman_args=${batman_args}'-g '$gateway_class' '
@@ -38,19 +37,19 @@ start () {
        if [ $routing_class ]; then
                batman_args=${batman_args}'-r '$routing_class' '
        fi
        if [ $routing_class ]; then
                batman_args=${batman_args}'-r '$routing_class' '
        fi
-               
+
        if [ $visualisation_srv ]; then
                batman_args=${batman_args}'-s '$visualisation_srv' '
        fi
        if [ $visualisation_srv ]; then
                batman_args=${batman_args}'-s '$visualisation_srv' '
        fi
-       
+
        if [ $policy_routing_script ]; then
                batman_args=${batman_args}'--policy-routing-script '$policy_routing_script' '
        fi
        if [ $policy_routing_script ]; then
                batman_args=${batman_args}'--policy-routing-script '$policy_routing_script' '
        fi
-       
+
        if [ $disable_client_nat ]; then
                batman_args=${batman_args}'--disable-client-nat '
        fi
        if [ $disable_client_nat ]; then
                batman_args=${batman_args}'--disable-client-nat '
        fi
-       
+
        if [ $disable_aggregation ]; then
                batman_args=${batman_args}'--disable-aggregation '
        fi
        if [ $disable_aggregation ]; then
                batman_args=${batman_args}'--disable-aggregation '
        fi
@@ -60,7 +59,5 @@ start () {
 }
 
 stop () {
 }
 
 stop () {
-        killall batmand
+       killall batmand
 }
 }
-
-        
index f14d945..ea16759 100644 (file)
@@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nodogsplash
 PKG_FIXUP:=autoreconf
 
 PKG_NAME:=nodogsplash
 PKG_FIXUP:=autoreconf
-PKG_VERSION:=3.3.0
+PKG_VERSION:=3.3.2
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)?
 PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)?
 PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz
-PKG_HASH:=ad89af14086982ebb07da6dd079c10e93e31af149e06611649d0dbee79cb8e67
+PKG_HASH:=5a7b14dd2cce6a8ca261a720d87948565fc2f05d4926bf155b9e0db483ff6bcb
 PKG_BUILD_DIR:=$(BUILD_DIR)/nodogsplash-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
 PKG_BUILD_DIR:=$(BUILD_DIR)/nodogsplash-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
@@ -26,7 +26,7 @@ define Package/nodogsplash
        SUBMENU:=Captive Portals
        SECTION:=net
        CATEGORY:=Network
        SUBMENU:=Captive Portals
        SECTION:=net
        CATEGORY:=Network
-       DEPENDS:=+libpthread +iptables-mod-ipopt +libmicrohttpd
+       DEPENDS:=+libpthread +iptables-mod-ipopt +libmicrohttpd-no-ssl
        TITLE:=Open public network gateway daemon
        URL:=https://github.com/nodogsplash/nodogsplash
        CONFLICTS:=nodogsplash2
        TITLE:=Open public network gateway daemon
        URL:=https://github.com/nodogsplash/nodogsplash
        CONFLICTS:=nodogsplash2
@@ -59,6 +59,7 @@ define Package/nodogsplash/install
        $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/init.d/nodogsplash $(1)/etc/init.d/
        $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/uci-defaults/40_nodogsplash $(1)/etc/uci-defaults/
        $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/usr/lib/nodogsplash/restart.sh $(1)/usr/lib/nodogsplash/
        $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/init.d/nodogsplash $(1)/etc/init.d/
        $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/etc/uci-defaults/40_nodogsplash $(1)/etc/uci-defaults/
        $(CP) $(PKG_BUILD_DIR)/openwrt/nodogsplash/files/usr/lib/nodogsplash/restart.sh $(1)/usr/lib/nodogsplash/
+       $(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/demo-preauth.sh $(1)/usr/lib/nodogsplash/login.sh
 endef
 
 define Package/nodogsplash/postrm
 endef
 
 define Package/nodogsplash/postrm
index 75f377e..85f2a75 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=olsrd
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=olsrd
-PKG_VERSION:=0.9.6.2
+PKG_VERSION:=0.9.7
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/OLSR/olsrd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/OLSR/olsrd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=v0.9.6.2
+PKG_SOURCE_VERSION:=v0.9.7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_BUILD_PARALLEL:=0
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_BUILD_PARALLEL:=0
diff --git a/smcroute/Makefile b/smcroute/Makefile
deleted file mode 100644 (file)
index e65c1de..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=smcroute
-PKG_VERSION:=2.0.0
-PKG_RELEASE:=2
-PKG_LICENSE:=GPL-2.0+
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://github.com/troglobit/smcroute/releases/download/$(PKG_VERSION)
-PKG_MD5SUM:=cbf478e52ab9ae411adca41b9d22f68a
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/smcroute
-       SECTION:=net
-       CATEGORY:=Network
-       SUBMENU:=Routing and Redirection
-       TITLE:=Static Multicast Routing Daemon
-       URL:=http://troglobit.com/smcroute.html
-       MAINTAINER:=Leonardo Brondani Schenkel <leonardo@schenkel.net>
-endef
-
-define Package/smcroute/description
-       SMCRoute is a command line tool to manipulate the multicast routes of the Linux kernel.
-endef
-
-ifeq ($(HOST_OS),FreeBSD)
-       TARGET_CFLAGS += -fno-builtin-log
-       TARGET_LDFLAGS += -fno-builtin-log
-endif
-
-define Build/Compile
-       $(MAKE) CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS)" -C $(PKG_BUILD_DIR) all
-endef
-
-define Package/smcroute/conffiles
-       /etc/smcroute.conf
-endef
-
-define Package/smcroute/install
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_DIR) $(1)/etc/init.d/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/smcroute $(1)/usr/sbin/
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/mcsender $(1)/usr/bin/
-       $(INSTALL_CONF) $(PKG_BUILD_DIR)/smcroute.conf $(1)/etc
-       $(INSTALL_BIN) ./files/smcroute.init $(1)/etc/init.d/smcroute
-endef
-
-$(eval $(call BuildPackage,smcroute))
diff --git a/smcroute/files/smcroute.init b/smcroute/files/smcroute.init
deleted file mode 100644 (file)
index 3e36272..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2010 OpenWrt.org
-START=50
-
-start() {
-       smcroute -d
-}
-
-stop() {
-       smcroute -k
-}
diff --git a/smcroute/patches/001-Make-output-of-build-id-optional.patch b/smcroute/patches/001-Make-output-of-build-id-optional.patch
deleted file mode 100644 (file)
index bffecc9..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-Author: Micha Lenk <micha@lenk.info>
-Date: Thu, 7 May 2015 21:54:31 +0200
-Description: Make output of build id optional
- With free software, anyone can inspect the source code for malicious flaws.
- But the software is often provided as binary packages to its users. The idea
- of “deterministic” or “reproducible” builds is to empower anyone to verify
- that no flaws have been introduced during the build process by reproducing
- byte-for-byte identical binary packages from a given source.  See also:
- https://wiki.debian.org/ReproducibleBuilds
- .
- Prior to this change a timestamp generated at build time is included in the
- output of 'smcroute -v'. As a result the binary is unreproducible.
- .
- With this change, users that still want 'smcroute -v' to include a build id
- can run './configure --enable-build-id' to get the build id back (or even
- specify a custom build id).
-Origin: upstream, https://github.com/troglobit/smcroute/commit/73f6f14907f709e40689216291621ad26cd22ecd
-Bug-Debian: https://bugs.debian.org/784694
-Last-Update: 2017-08-08
-
----
- configure.ac | 9 ++++++++-
- smcroute.c   | 6 +++++-
- 2 files changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 556d958..eb4a291 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -181,7 +181,14 @@ AC_COMPILE_IFELSE(
-   [AC_MSG_RESULT(no)])
- # Add build number to config.h.in
--AC_DEFINE_UNQUOTED([BUILD], "`date +%y%m%d`", [Build number, abbreviated date.])
-+AC_ARG_ENABLE([build-id],
-+  [AS_HELP_STRING([--enable-build-id@<:@=ID@:>@],
-+              [show build id in output of 'smcroute -v'])],
-+  [AS_IF([test "x$enableval" = "xyes" ],
-+    [build_id=`date +%y%m%d`],
-+    [build_id=$enableval])
-+   AC_DEFINE_UNQUOTED([BUILD], "$build_id", [Build number, abbreviated date.])])
-+
- # Checks for library functions.
- AC_FUNC_FORK
-diff --git a/smcroute.c b/smcroute.c
-index 7bd3c72..0287458 100644
---- a/smcroute.c
-+++ b/smcroute.c
-@@ -46,7 +46,11 @@ static const char *conf_file = SMCROUTE_SYSTEM_CONF;
- extern char *__progname;
- static const char version_info[] =
--      "SMCRoute version " PACKAGE_VERSION " build " BUILD "\n";
-+      "SMCRoute version " PACKAGE_VERSION
-+#ifdef BUILD
-+        " build " BUILD
-+#endif
-+        "\n";
- static const char usage_info[] =
-       "Usage: smcroute [OPTIONS]... [ARGS]...\n"
--- 
-2.11.0
-