From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v2 3/3] monitor: remove -F option
Date: Wed, 26 Oct 2022 13:45:59 -0700 [thread overview]
Message-ID: <20221026204559.502432-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20221026204559.502432-1-prestwoj@gmail.com>
This is now handled automatically by setting read_only which
bypasses the family ID check.
---
monitor/main.c | 31 ++++---------------------------
1 file changed, 4 insertions(+), 27 deletions(-)
diff --git a/monitor/main.c b/monitor/main.c
index 0cbab179..0c5f0670 100644
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -569,8 +569,7 @@ done:
return exit_status;
}
-static int process_pcap(struct pcap *pcap, uint16_t id,
- const struct nlmon_config *config)
+static int process_pcap(struct pcap *pcap, const struct nlmon_config *config)
{
struct nlmon *nlmon = NULL;
struct timeval tv;
@@ -587,7 +586,7 @@ static int process_pcap(struct pcap *pcap, uint16_t id,
return EXIT_FAILURE;
}
- nlmon = nlmon_create(id, config);
+ nlmon = nlmon_create(0, config);
while (pcap_read(pcap, &tv, buf, snaplen, &len, &real_len)) {
uint16_t arphrd_type;
@@ -696,13 +695,12 @@ int main(int argc, char *argv[])
const char *reader_path = NULL;
const char *analyze_path = NULL;
const char *ifname = NULL;
- uint16_t nl80211_family = 0;
int exit_status;
for (;;) {
int opt;
- opt = getopt_long(argc, argv, "r:w:a:F:i:nvhyse",
+ opt = getopt_long(argc, argv, "r:w:a:i:nvhyse",
main_options, NULL);
if (opt < 0)
break;
@@ -718,26 +716,6 @@ int main(int argc, char *argv[])
case 'a':
analyze_path = optarg;
break;
- case 'F':
- if (strlen(optarg) > 3) {
- if (!strncasecmp(optarg, "0x", 2) &&
- !isxdigit(optarg[2])) {
- usage();
- return EXIT_FAILURE;
- }
- nl80211_family = strtoul(optarg + 2, NULL, 16);
- } else {
- if (!isdigit(optarg[0])) {
- usage();
- return EXIT_FAILURE;
- }
- nl80211_family = strtoul(optarg, NULL, 10);
- }
- if (nl80211_family == 0) {
- usage();
- return EXIT_FAILURE;
- }
- break;
case 'i':
ifname = optarg;
break;
@@ -799,8 +777,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Invalid packet format\n");
exit_status = EXIT_FAILURE;
} else
- exit_status = process_pcap(pcap, nl80211_family,
- &config);
+ exit_status = process_pcap(pcap, &config);
pcap_close(pcap);
--
2.34.3
next prev parent reply other threads:[~2022-10-26 20:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 20:45 [PATCH v2 1/3] monitor: pass config to nlmon_create James Prestwood
2022-10-26 20:45 ` [PATCH v2 2/3] monitor: allow parsing pcaps without -F option James Prestwood
2022-10-26 20:45 ` James Prestwood [this message]
2022-10-26 21:49 ` [PATCH v2 1/3] monitor: pass config to nlmon_create Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221026204559.502432-3-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).