aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2005-02-22 19:17:28 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2005-02-22 19:17:28 +0000
commit7dccea9b20c60935a47b4898175e94610db0c80a (patch)
tree12293434cd270d65abe05e2d1917e141e6ece717 /tethereal.c
parentbb3310bd9d676578b79b303007b14f26ca7b0dc8 (diff)
Do not call the tap's initialization as soon as the -z option is read,
postpone it after the preferences callback has being called. That way mate's fields, which are registered by the preferences callback can be used as part of the tap's filter. svn path=/trunk/; revision=13469
Diffstat (limited to 'tethereal.c')
-rw-r--r--tethereal.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/tethereal.c b/tethereal.c
index e7a8a43fda..83f0b7046c 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -857,8 +857,9 @@ main(int argc, char *argv[])
dfilter_t *rfcode = NULL;
e_prefs *prefs;
char badopt;
- ethereal_tap_list *tli;
-
+ ethereal_tap_list *tli = NULL;
+ gboolean got_tap = FALSE;
+
#ifdef HAVE_LIBPCAP
/* XXX - better use capture_opts_init instead */
capture_opts.cfilter = g_strdup("");
@@ -1280,7 +1281,11 @@ main(int argc, char *argv[])
case 'z':
for(tli=tap_list;tli;tli=tli->next){
if(!strncmp(tli->cmd,optarg,strlen(tli->cmd))){
- (*tli->func)(optarg);
+ /* we won't call the init function for the tap this soon
+ as it would disallow mate's fields (which are registered
+ by the preferences set callback) from being used as
+ part of a tap filter */
+ got_tap = TRUE;
break;
}
}
@@ -1467,6 +1472,12 @@ main(int argc, char *argv[])
line that their preferences have changed. */
prefs_apply_all();
+ /* At this point mate will have registered its field array so we can
+ have a filter with one of mate's late registered fields as part
+ of the tap's filter */
+ if (got_tap)
+ (*tli->func)(optarg);
+
/* disabled protocols as per configuration file */
if (gdp_path == NULL && dp_path == NULL) {
set_disabled_protos_list();