diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-03-27 15:34:14 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-03-28 14:35:38 +0100 |
| commit | e2794c7543caf38027b08a1bfd10eb5dabbfeb83 (patch) | |
| tree | 890ce00f424cf5753b0aad43c146b766e8892bd5 | |
| parent | 57117e48aea21d70eb2fb4103a606c2b28593831 (diff) | |
| download | passt-e2794c7543caf38027b08a1bfd10eb5dabbfeb83.tar passt-e2794c7543caf38027b08a1bfd10eb5dabbfeb83.tar.gz passt-e2794c7543caf38027b08a1bfd10eb5dabbfeb83.tar.bz2 passt-e2794c7543caf38027b08a1bfd10eb5dabbfeb83.tar.lz passt-e2794c7543caf38027b08a1bfd10eb5dabbfeb83.tar.xz passt-e2794c7543caf38027b08a1bfd10eb5dabbfeb83.tar.zst passt-e2794c7543caf38027b08a1bfd10eb5dabbfeb83.zip | |
fwd: Comparing rule can be const
This pointer stepping through the array of existing rules can be const.
For some reason cppcheck doesn't catch this at the moment, but does with
certain changes we're looking at for the dynamic configuration client.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | fwd.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -362,7 +362,7 @@ void fwd_rule_add(struct fwd_table *fwd, uint8_t proto, uint8_t flags, /* Check for any conflicting entries */ for (i = 0; i < fwd->count; i++) { char newstr[INANY_ADDRSTRLEN], rulestr[INANY_ADDRSTRLEN]; - struct fwd_rule *rule = &fwd->rules[i]; + const struct fwd_rule *rule = &fwd->rules[i]; if (proto != rule->proto) /* Non-conflicting protocols */ |
