summaryrefslogtreecommitdiff
path: root/contrib/tcpdump
diff options
context:
space:
mode:
authorSlava Shwartsman <slavash@FreeBSD.org>2018-05-29 10:29:04 +0000
committerSlava Shwartsman <slavash@FreeBSD.org>2018-05-29 10:29:04 +0000
commitddeb4e8aa629682f90daea140de745e35ea4b742 (patch)
treed746eee480131bf37f6b5e93603458a425cc4dc4 /contrib/tcpdump
parentc5712d6da1ce9006a3147ab7c8be3b326d3dbc71 (diff)
parent810711ec13a9424633df50e0a1af057a68e2ed45 (diff)
downloadsrc-test-ddeb4e8aa629682f90daea140de745e35ea4b742.tar.gz
src-test-ddeb4e8aa629682f90daea140de745e35ea4b742.zip
MFV r333668:
Vendor import two upstream commits: c1bb8784abd3ca978e376b0d10e324db0491237b 9c4af7213cc2543a1f5586d8f2c19f86aa0cbe72 When using tcpdump -I -i wlanN and wlanN is not a monitor mode VAP, tcpdump will print an error message saying rfmon is not supported. Give a concise explanation as to how one might solve this problem by creating a monitor mode VAP. MFC after: 1 month Approved by: hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=334318
Diffstat (limited to 'contrib/tcpdump')
-rw-r--r--contrib/tcpdump/tcpdump.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c
index b3e60da22edda..d08c33ee6eb8c 100644
--- a/contrib/tcpdump/tcpdump.c
+++ b/contrib/tcpdump/tcpdump.c
@@ -77,7 +77,6 @@ The Regents of the University of California. All rights reserved.\n";
*/
#ifdef HAVE_CAPSICUM
#include <sys/capsicum.h>
-#include <sys/sysctl.h>
#include <sys/nv.h>
#include <sys/ioccom.h>
#include <net/bpf.h>
@@ -114,6 +113,10 @@ The Regents of the University of California. All rights reserved.\n";
#endif /* HAVE_CAP_NG_H */
#endif /* HAVE_LIBCAP_NG */
+#ifdef __FreeBSD__
+#include <sys/sysctl.h>
+#endif /* __FreeBSD__ */
+
#include "netdissect.h"
#include "interface.h"
#include "addrtoname.h"
@@ -1095,6 +1098,10 @@ open_interface(const char *device, netdissect_options *ndo, char *ebuf)
sysctlbyname(sysctl, parent, &s, NULL, 0);
strlcpy(newdev, device, sizeof(newdev));
/* Suggest a new wlan device. */
+ /* FIXME: incrementing the index this way is not going to work well
+ * when the index is 9 or greater but the only consequence in this
+ * specific case would be an error message that looks a bit odd.
+ */
newdev[strlen(newdev)-1]++;
error("%s is not a monitor mode VAP\n"
"To create a new monitor mode VAP use:\n"