From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30E4CA00C2; Mon, 2 Jan 2023 17:58:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20BEF42D1D; Mon, 2 Jan 2023 17:58:04 +0100 (CET) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id A876B42B7E for ; Mon, 2 Jan 2023 17:58:03 +0100 (CET) Received: by mail-pf1-f179.google.com with SMTP id c9so14093323pfj.5 for ; Mon, 02 Jan 2023 08:58:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Jdflnq1HzNXNVGWWT+18P1pLqKgw/FpWdukICMcZ7VE=; b=4v1/BPB8jFoAyPvuSYYKD/ljH+vV4f4sUdTibtDLbktGoVgR3VelaOJk+8et/xYO77 6LdWRDmQHSqdWE15Y+0NeAxa5ZoDBNVcuUp/SLrTwP4MChLlTXj/SKs/dH5XHbuLwncb fkYqQbf0v5WHC9PHNfi4b3vjEs+JmlBHaOSG64kBhPob+tReNgWxivL9BpddPcexAcPl N24XSUms2+5eE/ywWfoFNKXf7/OfSdwBOxIZMH6laX1Yyn0mzgFULaCIKvNPbCcNJBtC dO7PpDiX6uM7OJBAclbdrGGCaHdRRGfWoL2CMYL3Gnf60A+Wod6z8XlL3hoGg+K6TC36 HtvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jdflnq1HzNXNVGWWT+18P1pLqKgw/FpWdukICMcZ7VE=; b=npvwCDJSUcAZWlLvN2OiR6fEFTOfs91cXzfe34GDnvm8gA6b6BJiX1aSjjVDg2qTtp IL2jAD3ALQBBcLPqj92oYyYO1QytLSp1JNNEfFQ1ldnpzyMWMkvJ55DkokAliqN1y4Ol Z4rrlNRMx/WCmtfj3EDHbn/R5lOnvsdIvt+zg7anLMc+Bvzbx2tkKZi0z4FuWM+9ESOE /AXA65l/Q2NivzsLoP1uMUiCVey8RV5Fcsv/7mf5hqoOUIPdsgmM1+jkGC3oU7Wx0ztc m09evIbO5mQn1dHNTDS/GSDYyTSKPOfVKClhgae6Dn8Z51j71e5rM6+K3unVJcVC63xj cHNw== X-Gm-Message-State: AFqh2koLpTJUcHvFi8QWhOE4QMnEBAFODEZe6tj48BlzbUXjHGUHhK5C mVV/R8PyDEWYfVNTyrOPV5rJZw== X-Google-Smtp-Source: AMrXdXtsZDIJ7+PcqAtJN+AQwVB58QKnmRFaFQEqOLW46prQlUYwpEYzHAvnieBY83EHfQm/BqFeVQ== X-Received: by 2002:a62:2545:0:b0:581:fc19:4aa3 with SMTP id l66-20020a622545000000b00581fc194aa3mr13392745pfl.0.1672678682852; Mon, 02 Jan 2023 08:58:02 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id y188-20020a6264c5000000b00580e3917af7sm15676501pfb.117.2023.01.02.08.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 08:58:02 -0800 (PST) Date: Mon, 2 Jan 2023 08:58:02 -0800 From: Stephen Hemminger To: Ben Magistro Cc: dev@dpdk.org, ben.magistro@trinitycyber.com, stable@dpdk.org Subject: Re: [PATCH 2/6] app/dumpcap: fix storing port identifier Message-ID: <20230102085802.76a54cd2@hermes.local> In-Reply-To: <20230102162441.6205-2-koncept1@gmail.com> References: <20230102162441.6205-1-koncept1@gmail.com> <20230102162441.6205-2-koncept1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, 2 Jan 2023 16:24:37 +0000 Ben Magistro wrote: > When dumpcap adds an interface, the port was not being preserved. This > results in the structure being initialized and the port field being set > to 0 regardless of what port was actually selected. This unset field is > then used in both the enable and cleanup calls. This could result in the > capture occurring on the wrong interface. > > Fixes: d59fb4d ("app/dumpcap: add new packet capture application") > Cc: stephen@networkplumber.org > Cc: stable@dpdk.org > > Signed-off-by: Ben Magistro > --- > app/dumpcap/main.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c > index b9096f050c..aaee9349b1 100644 > --- a/app/dumpcap/main.c > +++ b/app/dumpcap/main.c > @@ -202,6 +202,7 @@ static void add_interface(uint16_t port, const char *name) > rte_exit(EXIT_FAILURE, "no memory for interface\n"); > > memset(intf, 0, sizeof(*intf)); > + intf->port = port; > rte_strscpy(intf->name, name, sizeof(intf->name)); > > printf("Capturing on '%s'\n", name); Will be superseded by my fixes to port setup.