aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2024-03-11 16:14:18 -0700
committerStephen Hemminger <stephen@networkplumber.org>2024-03-12 15:11:43 -0700
commit9fb634deec9e426c3a2478297ca3f093d2c225cb (patch)
tree42b7971d5cc8bf6120c20b8a53fcb49f017f5b77
parent38b0e6c120a8fff487745926b7a5e9146a06cb8f (diff)
downloadiproute2-9fb634deec9e426c3a2478297ca3f093d2c225cb.tar.gz
tc: make exec_util arg const
The callbacks in exec_util should not be modifying underlying qdisc operations structure. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--tc/e_bpf.c2
-rw-r--r--tc/tc_exec.c2
-rw-r--r--tc/tc_util.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/tc/e_bpf.c b/tc/e_bpf.c
index 79cddace9..cca853f95 100644
--- a/tc/e_bpf.c
+++ b/tc/e_bpf.c
@@ -49,7 +49,7 @@ static int bpf_num_env_entries(void)
return num;
}
-static int parse_bpf(struct exec_util *eu, int argc, char **argv)
+static int parse_bpf(const struct exec_util *eu, int argc, char **argv)
{
char **argv_run = argv_default, **envp_run, *tmp;
int ret, i, env_old, env_num, env_map;
diff --git a/tc/tc_exec.c b/tc/tc_exec.c
index 182fbb4c3..fe9fdb1b5 100644
--- a/tc/tc_exec.c
+++ b/tc/tc_exec.c
@@ -26,7 +26,7 @@ static void usage(void)
"OPTIONS := ... try tc exec <desired EXEC_KIND> help\n");
}
-static int parse_noeopt(struct exec_util *eu, int argc, char **argv)
+static int parse_noeopt(const struct exec_util *eu, int argc, char **argv)
{
if (argc) {
fprintf(stderr, "Unknown exec \"%s\", hence option \"%s\" is unparsable\n",
diff --git a/tc/tc_util.h b/tc/tc_util.h
index 5ae3fafd2..bbb2961df 100644
--- a/tc/tc_util.h
+++ b/tc/tc_util.h
@@ -68,7 +68,7 @@ struct action_util {
struct exec_util {
struct exec_util *next;
char id[FILTER_NAMESZ];
- int (*parse_eopt)(struct exec_util *eu, int argc, char **argv);
+ int (*parse_eopt)(const struct exec_util *eu, int argc, char **argv);
};
const char *get_tc_lib(void);