diff --git a/capture_sync.c b/capture_sync.c index fbc374bc39..310c917994 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -1623,11 +1623,17 @@ sync_pipe_input_cb(gint source, gpointer user_data) /* the capture child will close the sync_pipe, nothing to do for now */ /* (an error message doesn't mean we have to stop capturing) */ break; - case SP_BAD_FILTER: - /* FIXME: Indicate the correct index */ - capture_input_cfilter_error_message(capture_opts, 0, buffer); - /* the capture child will close the sync_pipe, nothing to do for now */ - break; + case SP_BAD_FILTER: { + char *ch; + int index; + + ch = strtok(buffer, ":"); + index = (int)strtol(ch, NULL, 10); + ch = strtok(NULL, ":"); + capture_input_cfilter_error_message(capture_opts, index, ch); + /* the capture child will close the sync_pipe, nothing to do for now */ + break; + } case SP_DROPS: capture_input_drops(capture_opts, (guint32)strtoul(buffer, NULL, 10)); break; diff --git a/dumpcap.c b/dumpcap.c index ae54145f26..da02aa6fce 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -4408,11 +4408,13 @@ static void report_cfilter_error(capture_options *capture_opts, guint i, const char *errmsg) { interface_options interface_opts; + char tmp[MSG_MAX_LENGTH+1+6]; if (i < capture_opts->ifaces->len) { if (capture_child) { + g_snprintf(tmp, sizeof(tmp), "%u:%s", i, errmsg); g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "Capture filter error: %s", errmsg); - pipe_write_block(2, SP_BAD_FILTER, errmsg); + pipe_write_block(2, SP_BAD_FILTER, tmp); } else { interface_opts = g_array_index(capture_opts->ifaces, interface_options, i); fprintf(stderr,