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 4111EA00C2; Wed, 4 Jan 2023 17:18:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2272C42D31; Wed, 4 Jan 2023 17:18:42 +0100 (CET) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 194EA42D2B for ; Wed, 4 Jan 2023 17:18:41 +0100 (CET) Received: by mail-pf1-f182.google.com with SMTP id e21so13604667pfl.1 for ; Wed, 04 Jan 2023 08:18:41 -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=H0ulSLyWPt/gXhFMK/hujsHVO7GkTFb3PBsd96a7Wo8=; b=jvWKcR+ZfzRnBFnwIuFj5PhLTBONB/wEhV/p7mirqc+aTIS+4wq3Sh5YFFp8IUT62s b8T43+MNFs9NIjTR+2p7ihmrehtqjETpNXoe61Ly3z075p7sYRY98FQWLjghDwfL7LSS 1rTw9by2dLkJfQGHG5sF/rhbo8wiX1B8hGIYyCsmXSMo5t8pBMkZLirZQI0mGINldGP+ lk4ej+9Z1hJm7k065V5+Kzd7d7D2byncX/as8S3Oymo9sXzeVDLHp5aSJXOb26rHcvwg jLtxachJLrYbG5VVA1Qbjy9FXbJzXZeoBgav08mNPADJALOyetoMm86bKb35kLnhkzAZ zH9A== 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=H0ulSLyWPt/gXhFMK/hujsHVO7GkTFb3PBsd96a7Wo8=; b=nzf4gHsFolLVmqonwZHIUM4NC74xj8GgRdODJ3ZVu4kPr9gVUrJ1XxjKiAJDuBZcW3 XFyH3imSZ4J4aMMvm7xvvtjCH5s/RmYoQGSAbLpi3pk79aQ/7cdhgN9A3kjOAvuVv4/6 cKTMgr26EJJeLe7WpnjeLdaWmgU/utQRb1hvrBB5DCoznk/sA1cZa0sm0McrR51fAosc pFvJZP9VaVNBr2lcdLEmQoRGvwWEMcCRJYxWPE034+/8ah4ci0Y9jJuxb+NVIMsNUhwB 8sOMQ2g4WBkXTryJcdTMf+fZ99MBQGT8rgcoLgPXTW7JgD2wprhGdTaCGFv8rQ51fywh 0j7Q== X-Gm-Message-State: AFqh2kqQ3UK1W90xdKaL/wW5lEkXbFQOukDyrfJ9wpE7OCbAQC3v8C06 3zdy+obLUh/UIjoToU3Na0YepA== X-Google-Smtp-Source: AMrXdXtJoUIogaLF5R+S2xKYu0hKbrZd6AMMUErrsWvSHt6WECyys64oLa418kewrEMJoFV0FLvtbQ== X-Received: by 2002:a62:b514:0:b0:581:a55:d213 with SMTP id y20-20020a62b514000000b005810a55d213mr30705897pfe.29.1672849120307; Wed, 04 Jan 2023 08:18:40 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id i123-20020a625481000000b00574ebfdc721sm23505962pfb.16.2023.01.04.08.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 08:18:40 -0800 (PST) Date: Tue, 3 Jan 2023 19:04:56 -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: <20230103190456.58d39457@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); LGTM Already set in the fix patch set