aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoshe Kaplan <me@moshekaplan.com>2019-08-23 18:22:18 -0400
committerAnders Broman <a.broman58@gmail.com>2019-08-24 20:18:30 +0000
commit5d12f7d597ff2e093d76a162ccd086c2efcfd15e (patch)
tree8453e33f0c1493f20d148dc1efa744c939c4d283
parent976da8e7fc999b3414f83db9a8c14c7b3658e878 (diff)
tshark: Warn on overwriting protocol filter
Change-Id: I41a56cf384cda91fa6ed217f7c292f325ec8c07f Reviewed-on: https://code.wireshark.org/review/34345 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--tshark.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tshark.c b/tshark.c
index b19cbf8dca..ee2be90fd3 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1162,9 +1162,15 @@ main(int argc, char *argv[])
}
break;
case 'j':
+ if (protocolfilter) {
+ cmdarg_err("-j or -J was already specified! Overwriting previous protocol filter");
+ }
protocolfilter = wmem_strsplit(wmem_epan_scope(), optarg, " ", -1);
break;
case 'J':
+ if (protocolfilter) {
+ cmdarg_err("-j or -J was already specified! Overwriting previous protocol filter");
+ }
protocolfilter_flags = PF_INCLUDE_CHILDREN;
protocolfilter = wmem_strsplit(wmem_epan_scope(), optarg, " ", -1);
break;