Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 May 2018 10:29:04 +0000 (UTC)
From:      Slava Shwartsman <slavash@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334318 - head/contrib/tcpdump
Message-ID:  <201805291029.w4TAT4JC040168@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: slavash
Date: Tue May 29 10:29:04 2018
New Revision: 334318
URL: https://svnweb.freebsd.org/changeset/base/334318

Log:
  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

Modified:
  head/contrib/tcpdump/tcpdump.c
Directory Properties:
  head/contrib/tcpdump/   (props changed)

Modified: head/contrib/tcpdump/tcpdump.c
==============================================================================
--- head/contrib/tcpdump/tcpdump.c	Tue May 29 10:28:20 2018	(r334317)
+++ head/contrib/tcpdump/tcpdump.c	Tue May 29 10:29:04 2018	(r334318)
@@ -77,7 +77,6 @@ The Regents of the University of California.  All righ
  */
 #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 righ
 #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 
 			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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805291029.w4TAT4JC040168>