prefs: set correct context for a preference

When a pref is renamed (e.g. from eth.qinq_ethertype to
vlan.qinq_ethertype), the latter module must be marked as changed.
Otherwise the pref has no effect as the vlan handoff routine is not
called.

For consistency, set the module for preferences migrated from smpp (the
gsm-sms-ud dissector does not have a handoff routine for these prefs,
so it has no functional effect for that dissector).

Undoes I89f4a2d125e18d113edec4bf35599f128249e913, fixes
I2a49dce93fdc7fab4ab3dc52dad90288c2d17434.

Change-Id: I255b49db23c7958f9fb2214c54f3f35386fa5e9a
Reviewed-on: https://code.wireshark.org/review/13851
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Peter Wu 2016-02-09 17:08:39 +01:00 committed by Anders Broman
parent 3e448549fc
commit e6f59d04aa
1 changed files with 7 additions and 3 deletions

View File

@ -4336,11 +4336,14 @@ set_pref(gchar *pref_name, const gchar *value, void *private_data _U_,
} else if (strcmp(module->name, "smpp") == 0) {
/* Handle preferences that moved from SMPP. */
module_t *new_module = prefs_find_module("gsm-sms-ud");
if (new_module){
if (strcmp(dotp, "port_number_udh_means_wsp") == 0)
if (new_module) {
if (strcmp(dotp, "port_number_udh_means_wsp") == 0) {
pref = prefs_find_preference(new_module, "port_number_udh_means_wsp");
else if (strcmp(dotp, "try_dissect_1st_fragment") == 0)
containing_module = new_module;
} else if (strcmp(dotp, "try_dissect_1st_fragment") == 0) {
pref = prefs_find_preference(new_module, "try_dissect_1st_fragment");
containing_module = new_module;
}
}
} else if (strcmp(module->name, "asn1") == 0) {
/* Handle old generic ASN.1 preferences (it's not really a
@ -4400,6 +4403,7 @@ set_pref(gchar *pref_name, const gchar *value, void *private_data _U_,
module_t *new_module = prefs_find_module("vlan");
if (new_module) {
pref = prefs_find_preference(new_module, "qinq_ethertype");
containing_module = new_module;
}
}
} else if (strcmp(module->name, "taps") == 0) {