diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2016-06-13 15:28:16 -0400 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2016-06-15 05:38:01 +0000 |
commit | 3a590217ac60d626cb126aff593b43901585224c (patch) | |
tree | 0e75c2b174f6ef9ee1b5837c60cffe9d0515519b /epan/proto.h | |
parent | 22fd85d178e52b23a192737f16957d24886d0a5d (diff) |
Change how dissectors do late-field-registration to avoid a double-registration
assertion.
If a dissector forces registration of fields during dissection it needs to do
so in a way that clears the prefix registration. Otherwise epan will call the
registration routine a 2nd time (which will cause us to assert out) if a user
types a display filter (with the dissector's prefix) that doesn't exist.
Update the proto_register_prefix() comments to reflect this.
Change-Id: I3ce29243395fb55192bb5dfd950baa88410ac136
Reviewed-on: https://code.wireshark.org/review/15881
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/proto.h b/epan/proto.h index ecc534ae7b..56f78350c1 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -2097,7 +2097,8 @@ typedef void (*prefix_initializer_t)(const char* match); /** Register a new prefix for delayed initialization of field arrays Note that the initializer function MAY NOT be called before the dissector is first called. That is, dissectors using this function must be prepared - to call the initializer before beginning dissection. + to call the initializer before beginning dissection; they should do this by + calling proto_registrar_get_byname() on one of the dissector's field names. @param prefix the prefix for the new protocol @param initializer function that will initialize the field array for the given prefix */ WS_DLL_PUBLIC void |