|
| 1 | +From e5fe59cb58e43afeacabebd043656f7c80c48eb1 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Grische <github@grische.xyz> |
| 3 | +Date: Sun, 12 Apr 2026 16:54:55 +0200 |
| 4 | +Subject: [PATCH 02/11] fixup! treewide: add Batman V support |
| 5 | + |
| 6 | +rename version-specific variables with _batadv_{iv,v} suffix |
| 7 | +--- |
| 8 | + .../gluon-mesh-batman-adv/src/respondd-neighbours.c | 12 ++++++------ |
| 9 | + .../gluon-mesh-batman-adv/src/respondd-statistics.c | 12 ++++++------ |
| 10 | + package/gluon-radv-filterd/src/gluon-radv-filterd.c | 12 ++++++------ |
| 11 | + .../src/neighbours-batadv.c | 12 ++++++------ |
| 12 | + 4 files changed, 24 insertions(+), 24 deletions(-) |
| 13 | + |
| 14 | +diff --git a/package/gluon-mesh-batman-adv/src/respondd-neighbours.c b/package/gluon-mesh-batman-adv/src/respondd-neighbours.c |
| 15 | +index c68d93fd..ea12003e 100644 |
| 16 | +--- a/package/gluon-mesh-batman-adv/src/respondd-neighbours.c |
| 17 | ++++ b/package/gluon-mesh-batman-adv/src/respondd-neighbours.c |
| 18 | +@@ -47,7 +47,7 @@ static struct json_object * ifnames2addrs(struct json_object *interfaces) { |
| 19 | + } |
| 20 | + |
| 21 | + /* Batman IV mandatory attrs */ |
| 22 | +-static const enum batadv_nl_attrs parse_orig_list_iv_mandatory[] = { |
| 23 | ++static const enum batadv_nl_attrs parse_orig_list_mandatory_batadv_iv[] = { |
| 24 | + BATADV_ATTR_ORIG_ADDRESS, |
| 25 | + BATADV_ATTR_NEIGH_ADDRESS, |
| 26 | + BATADV_ATTR_TQ, |
| 27 | +@@ -56,7 +56,7 @@ static const enum batadv_nl_attrs parse_orig_list_iv_mandatory[] = { |
| 28 | + }; |
| 29 | + |
| 30 | + /* Batman V mandatory attrs */ |
| 31 | +-static const enum batadv_nl_attrs parse_neigh_list_v_mandatory[] = { |
| 32 | ++static const enum batadv_nl_attrs parse_neigh_list_mandatory_batadv_v[] = { |
| 33 | + BATADV_ATTR_NEIGH_ADDRESS, |
| 34 | + BATADV_ATTR_THROUGHPUT, |
| 35 | + BATADV_ATTR_HARD_IFINDEX, |
| 36 | +@@ -93,8 +93,8 @@ static int parse_orig_neigh_list_netlink_cb(struct nl_msg *msg, void *arg) |
| 37 | + if (ghdr->cmd != BATADV_CMD_GET_NEIGHBORS) |
| 38 | + return NL_OK; |
| 39 | + |
| 40 | +- if (batadv_genl_missing_attrs(attrs, parse_neigh_list_v_mandatory, |
| 41 | +- BATADV_ARRAY_SIZE(parse_neigh_list_v_mandatory))) |
| 42 | ++ if (batadv_genl_missing_attrs(attrs, parse_neigh_list_mandatory_batadv_v, |
| 43 | ++ BATADV_ARRAY_SIZE(parse_neigh_list_mandatory_batadv_v))) |
| 44 | + return NL_OK; |
| 45 | + |
| 46 | + mac = nla_data(attrs[BATADV_ATTR_NEIGH_ADDRESS]); |
| 47 | +@@ -103,8 +103,8 @@ static int parse_orig_neigh_list_netlink_cb(struct nl_msg *msg, void *arg) |
| 48 | + if (ghdr->cmd != BATADV_CMD_GET_ORIGINATORS) |
| 49 | + return NL_OK; |
| 50 | + |
| 51 | +- if (batadv_genl_missing_attrs(attrs, parse_orig_list_iv_mandatory, |
| 52 | +- BATADV_ARRAY_SIZE(parse_orig_list_iv_mandatory))) |
| 53 | ++ if (batadv_genl_missing_attrs(attrs, parse_orig_list_mandatory_batadv_iv, |
| 54 | ++ BATADV_ARRAY_SIZE(parse_orig_list_mandatory_batadv_iv))) |
| 55 | + return NL_OK; |
| 56 | + |
| 57 | + mac = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); |
| 58 | +diff --git a/package/gluon-mesh-batman-adv/src/respondd-statistics.c b/package/gluon-mesh-batman-adv/src/respondd-statistics.c |
| 59 | +index a73ebeef..dfb9200d 100644 |
| 60 | +--- a/package/gluon-mesh-batman-adv/src/respondd-statistics.c |
| 61 | ++++ b/package/gluon-mesh-batman-adv/src/respondd-statistics.c |
| 62 | +@@ -39,13 +39,13 @@ struct gw_netlink_opts { |
| 63 | + }; |
| 64 | + |
| 65 | + |
| 66 | +-static const enum batadv_nl_attrs gateways_iv_mandatory[] = { |
| 67 | ++static const enum batadv_nl_attrs gateways_mandatory_batadv_iv[] = { |
| 68 | + BATADV_ATTR_ORIG_ADDRESS, |
| 69 | + BATADV_ATTR_ROUTER, |
| 70 | + BATADV_ATTR_TQ, |
| 71 | + }; |
| 72 | + |
| 73 | +-static const enum batadv_nl_attrs gateways_v_mandatory[] = { |
| 74 | ++static const enum batadv_nl_attrs gateways_mandatory_batadv_v[] = { |
| 75 | + BATADV_ATTR_ORIG_ADDRESS, |
| 76 | + BATADV_ATTR_ROUTER, |
| 77 | + BATADV_ATTR_THROUGHPUT, |
| 78 | +@@ -78,12 +78,12 @@ static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg) |
| 79 | + return NL_OK; |
| 80 | + |
| 81 | + if (opts->is_batman_v) { |
| 82 | +- if (batadv_genl_missing_attrs(attrs, gateways_v_mandatory, |
| 83 | +- BATADV_ARRAY_SIZE(gateways_v_mandatory))) |
| 84 | ++ if (batadv_genl_missing_attrs(attrs, gateways_mandatory_batadv_v, |
| 85 | ++ BATADV_ARRAY_SIZE(gateways_mandatory_batadv_v))) |
| 86 | + return NL_OK; |
| 87 | + } else { |
| 88 | +- if (batadv_genl_missing_attrs(attrs, gateways_iv_mandatory, |
| 89 | +- BATADV_ARRAY_SIZE(gateways_iv_mandatory))) |
| 90 | ++ if (batadv_genl_missing_attrs(attrs, gateways_mandatory_batadv_iv, |
| 91 | ++ BATADV_ARRAY_SIZE(gateways_mandatory_batadv_iv))) |
| 92 | + return NL_OK; |
| 93 | + } |
| 94 | + |
| 95 | +diff --git a/package/gluon-radv-filterd/src/gluon-radv-filterd.c b/package/gluon-radv-filterd/src/gluon-radv-filterd.c |
| 96 | +index 02f4fe75..3334d88c 100644 |
| 97 | +--- a/package/gluon-radv-filterd/src/gluon-radv-filterd.c |
| 98 | ++++ b/package/gluon-radv-filterd/src/gluon-radv-filterd.c |
| 99 | +@@ -437,12 +437,12 @@ static int parse_tt_global(struct nl_msg *msg, |
| 100 | + return NL_OK; |
| 101 | + } |
| 102 | + |
| 103 | +-static const enum batadv_nl_attrs originator_iv_mandatory[] = { |
| 104 | ++static const enum batadv_nl_attrs originator_mandatory_batadv_iv[] = { |
| 105 | + BATADV_ATTR_ORIG_ADDRESS, |
| 106 | + BATADV_ATTR_TQ, |
| 107 | + }; |
| 108 | + |
| 109 | +-static const enum batadv_nl_attrs originator_v_mandatory[] = { |
| 110 | ++static const enum batadv_nl_attrs originator_mandatory_batadv_v[] = { |
| 111 | + BATADV_ATTR_ORIG_ADDRESS, |
| 112 | + BATADV_ATTR_THROUGHPUT, |
| 113 | + }; |
| 114 | +@@ -473,12 +473,12 @@ static int parse_originator(struct nl_msg *msg, |
| 115 | + } |
| 116 | + |
| 117 | + if (G.algo == ALGO_BATMAN_V) { |
| 118 | +- if (batadv_genl_missing_attrs(attrs, originator_v_mandatory, |
| 119 | +- ARRAY_SIZE(originator_v_mandatory))) |
| 120 | ++ if (batadv_genl_missing_attrs(attrs, originator_mandatory_batadv_v, |
| 121 | ++ ARRAY_SIZE(originator_mandatory_batadv_v))) |
| 122 | + return NL_OK; |
| 123 | + } else { |
| 124 | +- if (batadv_genl_missing_attrs(attrs, originator_iv_mandatory, |
| 125 | +- ARRAY_SIZE(originator_iv_mandatory))) |
| 126 | ++ if (batadv_genl_missing_attrs(attrs, originator_mandatory_batadv_iv, |
| 127 | ++ ARRAY_SIZE(originator_mandatory_batadv_iv))) |
| 128 | + return NL_OK; |
| 129 | + } |
| 130 | + |
| 131 | +diff --git a/package/gluon-status-page-mesh-batman-adv/src/neighbours-batadv.c b/package/gluon-status-page-mesh-batman-adv/src/neighbours-batadv.c |
| 132 | +index 3cb86d42..670abb45 100644 |
| 133 | +--- a/package/gluon-status-page-mesh-batman-adv/src/neighbours-batadv.c |
| 134 | ++++ b/package/gluon-status-page-mesh-batman-adv/src/neighbours-batadv.c |
| 135 | +@@ -17,7 +17,7 @@ struct neigh_netlink_opts { |
| 136 | + }; |
| 137 | + |
| 138 | + /* Batman IV mandatory attrs */ |
| 139 | +-static const enum batadv_nl_attrs parse_orig_list_iv_mandatory[] = { |
| 140 | ++static const enum batadv_nl_attrs parse_orig_list_mandatory_batadv_iv[] = { |
| 141 | + BATADV_ATTR_ORIG_ADDRESS, |
| 142 | + BATADV_ATTR_NEIGH_ADDRESS, |
| 143 | + BATADV_ATTR_TQ, |
| 144 | +@@ -26,7 +26,7 @@ static const enum batadv_nl_attrs parse_orig_list_iv_mandatory[] = { |
| 145 | + }; |
| 146 | + |
| 147 | + /* Batman V mandatory attrs */ |
| 148 | +-static const enum batadv_nl_attrs parse_neigh_list_v_mandatory[] = { |
| 149 | ++static const enum batadv_nl_attrs parse_neigh_list_mandatory_batadv_v[] = { |
| 150 | + BATADV_ATTR_NEIGH_ADDRESS, |
| 151 | + BATADV_ATTR_THROUGHPUT, |
| 152 | + BATADV_ATTR_HARD_IFINDEX, |
| 153 | +@@ -60,8 +60,8 @@ static int parse_orig_neigh_list_netlink_cb(struct nl_msg *msg, void *arg) |
| 154 | + if (ghdr->cmd != BATADV_CMD_GET_NEIGHBORS) |
| 155 | + return NL_OK; |
| 156 | + |
| 157 | +- if (batadv_genl_missing_attrs(attrs, parse_neigh_list_v_mandatory, |
| 158 | +- BATADV_ARRAY_SIZE(parse_neigh_list_v_mandatory))) |
| 159 | ++ if (batadv_genl_missing_attrs(attrs, parse_neigh_list_mandatory_batadv_v, |
| 160 | ++ BATADV_ARRAY_SIZE(parse_neigh_list_mandatory_batadv_v))) |
| 161 | + return NL_OK; |
| 162 | + |
| 163 | + mac = nla_data(attrs[BATADV_ATTR_NEIGH_ADDRESS]); |
| 164 | +@@ -69,8 +69,8 @@ static int parse_orig_neigh_list_netlink_cb(struct nl_msg *msg, void *arg) |
| 165 | + if (ghdr->cmd != BATADV_CMD_GET_ORIGINATORS) |
| 166 | + return NL_OK; |
| 167 | + |
| 168 | +- if (batadv_genl_missing_attrs(attrs, parse_orig_list_iv_mandatory, |
| 169 | +- BATADV_ARRAY_SIZE(parse_orig_list_iv_mandatory))) |
| 170 | ++ if (batadv_genl_missing_attrs(attrs, parse_orig_list_mandatory_batadv_iv, |
| 171 | ++ BATADV_ARRAY_SIZE(parse_orig_list_mandatory_batadv_iv))) |
| 172 | + return NL_OK; |
| 173 | + |
| 174 | + mac = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); |
| 175 | +-- |
| 176 | +2.43.0 |
| 177 | + |
0 commit comments