From 5d12f7d597ff2e093d76a162ccd086c2efcfd15e Mon Sep 17 00:00:00 2001 From: Moshe Kaplan Date: Fri, 23 Aug 2019 18:22:18 -0400 Subject: tshark: Warn on overwriting protocol filter Change-Id: I41a56cf384cda91fa6ed217f7c292f325ec8c07f Reviewed-on: https://code.wireshark.org/review/34345 Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- tshark.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3