From owner-svn-src-all@freebsd.org Wed May 23 21:39:20 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 F2EFEEE6CBC; Wed, 23 May 2018 21:39:19 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84C8380139; Wed, 23 May 2018 21:39:19 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-it0-x242.google.com with SMTP id c3-v6so6214997itj.4; Wed, 23 May 2018 14:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qggMpv4dl59SoMm80hw2SNYVVlEIDlV+jbtJJLfhe4c=; b=cXurZe0xefyMeUdLv8xSx1WO5Bt92AQhuGRUXaD6WqC9IqPD7SIqB2uMU/7RQ+MBYy lHmVqMq1j5wr6vzTTXkj+lex5PAh/ElThg1jWi7pIjnUq2SVaWlG0WiDVm3KB07wfPqa x+ULwgFk1tPbd27rSLd6Frxya2C1rReSvGtUwntvZlcdHlKgu9RCTlyJpnZqUzDeHKaL ZgVGGfSu+2tX3MRWGbJlsua8WoeRMhyYN+g/Tc1Ay+wLXU2pyw065nCAmuhgOzsv8y/l 2b3zIOXAciUkXzlIDsE9ELD1QryvwZrYbbG8szj8k4R4sh03ceq/rJQjTtZerkgGRDkV qzlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qggMpv4dl59SoMm80hw2SNYVVlEIDlV+jbtJJLfhe4c=; b=O2P3x3ZgQflPzVPHMvGP4G63ZXGpZoLxjF62hHTOoP/L2Okfr2918erckW70qgtDxD ZUHOA7jxGy2H4dOAQTrQoV03u1DDacRsuoNCMON/xKXY1u8bByGTBmJg4Vb64mJiL1Rd hA+yaLNXfgVVe/gzgYEcOE93oyanB/gLcvw9YvjNzMDHANHnHG0vjxkBeaFy0p/jpyvo 87q16vCpXyHcn6o+D6v04Tk+xcwg3uAKx7bDeidjTOc6srF7stvxw4oS9VurMwseXfYM 8xDngYJamtOtKgnsryhnYroZFC4zx9hQJ6w3k8gr10Lgmp02Eikgi0pUKOfV1K/TUbcJ TySg== X-Gm-Message-State: ALKqPwfqA9khwNAs+fxQJ/paVZoN09CNJY4lCM/jhKB5DU/SPAl1xhof QRBpolvT+nhksHP2x/SGDQWVm/OzGRefZx31rUx9+A== X-Google-Smtp-Source: AB8JxZr1ZGCw//Ev655GzjCYeSfcfDCWcoBtv23zcudclS8TEaGZ7tcKt/YJ3ShKEJIcAPQKkeqltyB6zBnYJ+muSD8= X-Received: by 2002:a24:438f:: with SMTP id s137-v6mr6442970itb.28.1527111558348; Wed, 23 May 2018 14:39:18 -0700 (PDT) MIME-Version: 1.0 References: <201805160843.w4G8h8oW050800@repo.freebsd.org> <20180523212513.GR71675@FreeBSD.org> In-Reply-To: <20180523212513.GR71675@FreeBSD.org> From: Xin LI Date: Wed, 23 May 2018 14:39:06 -0700 Message-ID: Subject: Re: svn commit: r333668 - vendor/tcpdump/dist To: Gleb Smirnoff Cc: slavash@freebsd.org, hselasky@freebsd.org, Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@freebsd.org Content-Type: text/plain; charset="UTF-8" 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:39:20 -0000 On Wed, May 23, 2018 at 2:25 PM Gleb Smirnoff wrote: > Hi, > do we commit cherry-picks into vendor/ subversion space? I believe we don't. Yes we do. Actually doing it _properly_ would make future imports easier. > Cherry-picks should go directly to head. vendor/ should get only tagged > full tree updates. No, that would make future merges harder. Let's say you want to apply a patchset P, if it's already accepted by upstream, you would do: - Commit it against vendor/.../dist - "svn merge -c ^..../dist" or merge -r: If the patchset was not accepted at the time, but later accepted as-is, you would compensate the local change with: - Commit it against vendor/.../dist - "svn merge -c ... --record-only ..." Lastly, if the patchset was adopted by upstream with changes, you would do a similar change for the first one, but tweak the local copy to reduce diff against the cherry-picked dist/ version. This way, svn would know that the change is already done in dist/ and calculate diff's more accurately for future merges. Note that Slava didn't commit the mergeinfo update in head/, which should be done to take advantage of this maneuver. Without it, svn would have problem figuring the right delta. > 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