]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: make exec_util arg const
authorStephen Hemminger <stephen@networkplumber.org>
Mon, 11 Mar 2024 23:14:18 +0000 (16:14 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 12 Mar 2024 22:11:43 +0000 (15:11 -0700)
The callbacks in exec_util should not be modifying underlying
qdisc operations structure.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/e_bpf.c
tc/tc_exec.c
tc/tc_util.h

index 79cddace96a4af4b8799e6f31c9aaecc4dc1c401..cca853f9529930b2e41186c82f2e2f58bc8f18ba 100644 (file)
@@ -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;
index 182fbb4c35c9567dd210a887864e3e5cfaf8b14a..fe9fdb1b5aa661910d4fa6e240d68a157ed612a0 100644 (file)
@@ -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",
index 5ae3fafd2dd2b10ea588992874e5d37f920faf4e..bbb2961dfe93ca66d6538d5a0faa4672e9e28113 100644 (file)
@@ -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);