]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Warn that options -A, -x[x] and -X[X] are mutually exclusive
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 1 Dec 2024 19:42:43 +0000 (20:42 +0100)
committerfxlb <[email protected]>
Mon, 2 Dec 2024 08:55:59 +0000 (08:55 +0000)
[skip ci]

tcpdump.c

index 60fc81d61480c56870f3168b1b5cd224d64987cd..9c7cb0190d1dc6ed93868870da77d5d7f40fb4af 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -2100,6 +2100,13 @@ main(int argc, char **argv)
                        /* NOTREACHED */
                }
 
+       if (ndo->ndo_Aflag && ndo->ndo_xflag)
+               warning("-A and -x[x] are mutually exclusive. -A ignored.");
+       if (ndo->ndo_Aflag && ndo->ndo_Xflag)
+               warning("-A and -X[X] are mutually exclusive. -A ignored.");
+       if (ndo->ndo_xflag && ndo->ndo_Xflag)
+               warning("-x[x] and -X[X] are mutually exclusive. -x[x] ignored.");
+
        if (Dflag)
                show_devices_and_exit();
 #ifdef HAVE_PCAP_FINDALLDEVS_EX