3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

monitor: remove -F option

This is now handled automatically by setting read_only which
bypasses the family ID check.
This commit is contained in:
James Prestwood 2022-10-26 13:45:59 -07:00 committed by Denis Kenzior
parent ad51250835
commit 13bdb5ee80

View File

@ -569,8 +569,7 @@ done:
return exit_status; return exit_status;
} }
static int process_pcap(struct pcap *pcap, uint16_t id, static int process_pcap(struct pcap *pcap, const struct nlmon_config *config)
const struct nlmon_config *config)
{ {
struct nlmon *nlmon = NULL; struct nlmon *nlmon = NULL;
struct timeval tv; struct timeval tv;
@ -587,7 +586,7 @@ static int process_pcap(struct pcap *pcap, uint16_t id,
return EXIT_FAILURE; return EXIT_FAILURE;
} }
nlmon = nlmon_create(id, config); nlmon = nlmon_create(0, config);
while (pcap_read(pcap, &tv, buf, snaplen, &len, &real_len)) { while (pcap_read(pcap, &tv, buf, snaplen, &len, &real_len)) {
uint16_t arphrd_type; uint16_t arphrd_type;
@ -696,13 +695,12 @@ int main(int argc, char *argv[])
const char *reader_path = NULL; const char *reader_path = NULL;
const char *analyze_path = NULL; const char *analyze_path = NULL;
const char *ifname = NULL; const char *ifname = NULL;
uint16_t nl80211_family = 0;
int exit_status; int exit_status;
for (;;) { for (;;) {
int opt; 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); main_options, NULL);
if (opt < 0) if (opt < 0)
break; break;
@ -718,26 +716,6 @@ int main(int argc, char *argv[])
case 'a': case 'a':
analyze_path = optarg; analyze_path = optarg;
break; 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': case 'i':
ifname = optarg; ifname = optarg;
break; break;
@ -799,8 +777,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Invalid packet format\n"); fprintf(stderr, "Invalid packet format\n");
exit_status = EXIT_FAILURE; exit_status = EXIT_FAILURE;
} else } else
exit_status = process_pcap(pcap, nl80211_family, exit_status = process_pcap(pcap, &config);
&config);
pcap_close(pcap); pcap_close(pcap);