diff options
author | Guy Harris <gharris@sonic.net> | 2020-06-18 18:14:46 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-06-19 11:32:26 +0000 |
commit | e1d9a226a2b8f2824a0eb162a8dc972e6e6c2dd4 (patch) | |
tree | 75f56e3f0dde68ec92613cea3f482f7f426625de /epan/dissectors/packet-dhcpv6.c | |
parent | 51bb2c4d7f515a24659ba0c0048392a81becda4e (diff) |
Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.
Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.
Also make some of those arrays static while we're at it.
Update documentation and dissector-generator tools.
Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-dhcpv6.c')
-rw-r--r-- | epan/dissectors/packet-dhcpv6.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index 06021b81d1..b8b3348dee 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -951,13 +951,13 @@ static const value_string failover_server_state_vals[] = { { 0, NULL }, }; -static const int *dhcpv6_failover_connect_flags_fields[] = { +static int * const dhcpv6_failover_connect_flags_fields[] = { &hf_option_failover_connect_reserved_flag, &hf_option_failover_connect_f_flag, NULL }; -static const int *dhcpv6_failover_dns_flags_fields[] = { +static int * const dhcpv6_failover_dns_flags_fields[] = { &hf_option_failover_dns_reserved_flag, &hf_option_failover_dns_u_flag, &hf_option_failover_dns_s_flag, @@ -966,7 +966,7 @@ static const int *dhcpv6_failover_dns_flags_fields[] = { NULL }; -static const int *dhcpv6_failover_server_flags_fields[] = { +static int * const dhcpv6_failover_server_flags_fields[] = { &hf_option_failover_server_reserved_flag, &hf_option_failover_server_a_flag, &hf_option_failover_server_s_flag, @@ -980,7 +980,7 @@ typedef struct hopcount_info_t { gboolean relay_message_previously_detected; } hopcount_info; -static const int *dhcpv6_s46_rule_flags_fields[] = { +static int * const dhcpv6_s46_rule_flags_fields[] = { &hf_option_s46_rule_reserved_flag, &hf_option_s46_rule_fmr_flag, NULL |