From owner-svn-src-all@freebsd.org Wed May 23 21:25:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AD59EE6624; Wed, 23 May 2018 21:25:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 80FE97F4FA; Wed, 23 May 2018 21:25:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w4NLPDkG085124 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 23 May 2018 14:25:13 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w4NLPDkS085123; Wed, 23 May 2018 14:25:13 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 23 May 2018 14:25:13 -0700 From: Gleb Smirnoff To: Slava Shwartsman Cc: hselasky@FreeBSD.org, kib@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r333668 - vendor/tcpdump/dist Message-ID: <20180523212513.GR71675@FreeBSD.org> References: <201805160843.w4G8h8oW050800@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805160843.w4G8h8oW050800@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 21:25:19 -0000 Hi, do we commit cherry-picks into vendor/ subversion space? I believe we don't. Cherry-picks should go directly to head. vendor/ should get only tagged full tree updates. On Wed, May 16, 2018 at 08:43:08AM +0000, Slava Shwartsman wrote: S> Author: slavash S> Date: Wed May 16 08:43:08 2018 S> New Revision: 333668 S> URL: https://svnweb.freebsd.org/changeset/base/333668 S> S> Log: S> Vendor import two upstream commits: S> c1bb8784abd3ca978e376b0d10e324db0491237b S> 9c4af7213cc2543a1f5586d8f2c19f86aa0cbe72 S> S> When using tcpdump -I -i wlanN and wlanN is not a monitor mode VAP, S> tcpdump will print an error message saying rfmon is not supported. S> S> Give a concise explanation as to how one might solve this problem by S> creating a monitor mode VAP. S> S> Approved by: hselasky (mentor), kib (mentor) S> Sponsored by: Mellanox Technologies S> S> Modified: S> vendor/tcpdump/dist/tcpdump.c S> S> Modified: vendor/tcpdump/dist/tcpdump.c S> ============================================================================== S> --- vendor/tcpdump/dist/tcpdump.c Wed May 16 06:52:08 2018 (r333667) S> +++ vendor/tcpdump/dist/tcpdump.c Wed May 16 08:43:08 2018 (r333668) S> @@ -108,6 +108,10 @@ The Regents of the University of California. All righ S> #endif /* HAVE_CAP_NG_H */ S> #endif /* HAVE_LIBCAP_NG */ S> S> +#ifdef __FreeBSD__ S> +#include S> +#endif /* __FreeBSD__ */ S> + S> #include "netdissect.h" S> #include "interface.h" S> #include "addrtoname.h" S> @@ -1044,6 +1048,30 @@ open_interface(const char *device, netdissect_options S> } else if (status == PCAP_ERROR_PERM_DENIED && *cp != '\0') S> error("%s: %s\n(%s)", device, S> pcap_statustostr(status), cp); S> +#ifdef __FreeBSD__ S> + else if (status == PCAP_ERROR_RFMON_NOTSUP && S> + strncmp(device, "wlan", 4) == 0) { S> + char parent[8], newdev[8]; S> + char sysctl[32]; S> + size_t s = sizeof(parent); S> + S> + snprintf(sysctl, sizeof(sysctl), S> + "net.wlan.%d.%%parent", atoi(device + 4)); S> + sysctlbyname(sysctl, parent, &s, NULL, 0); S> + strlcpy(newdev, device, sizeof(newdev)); S> + /* Suggest a new wlan device. */ S> + /* FIXME: incrementing the index this way is not going to work well S> + * when the index is 9 or greater but the only consequence in this S> + * specific case would be an error message that looks a bit odd. S> + */ S> + newdev[strlen(newdev)-1]++; S> + error("%s is not a monitor mode VAP\n" S> + "To create a new monitor mode VAP use:\n" S> + " ifconfig %s create wlandev %s wlanmode monitor\n" S> + "and use %s as the tcpdump interface", S> + device, newdev, parent, newdev); S> + } S> +#endif S> else S> error("%s: %s", device, S> pcap_statustostr(status)); S> -- Gleb Smirnoff