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 32CD5A00C2; Mon, 2 Jan 2023 17:25:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C3DF42D0C; Mon, 2 Jan 2023 17:25:35 +0100 (CET) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by mails.dpdk.org (Postfix) with ESMTP id 01F2C42D0C; Mon, 2 Jan 2023 17:25:34 +0100 (CET) Received: by mail-qt1-f181.google.com with SMTP id c7so22722329qtw.8; Mon, 02 Jan 2023 08:25:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rNiptyipccaYx9siVWXHOCaJfzcTCqDDOOOO7GwmBKQ=; b=dE9Uz+mlzKe9qi1QPwtGEi+pbl/NcdnhfVTjyFJ7lvnOFj1TtIrreS/D91rth53CD2 hqJZdZOJDJyHCnkRuFJ4R6g0HafcIcrl34YNM5xB/JuvG3r7EawlAFv1ugz44HSWYT1Z YxMTeZTWwOlgUEl/sDsdV5QHLo/hlyzMR3rpSJsH7zBFI9zLuhY0/TV6Q3bNRuvxr+Tn TF9/iguSoYie3g0Ft1K+DPVQrPJcR+Ir3nl2hHhbTjWKjbl5JSEiPOHdFvO5eoT7lfZ5 XBGRyENaQsQ1lp/lTVi3orEYA5HpFCV3zK17m3kwsLElQIOoOcQE2UJud4gwHe/38hzZ ZxmQ== 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:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rNiptyipccaYx9siVWXHOCaJfzcTCqDDOOOO7GwmBKQ=; b=VYOBHrdkcT5jknfKyNHI2eNqxYrdwNCQrAmv1oEaIwYFukrwehg6IYivmwy9ZZa+pq Q98Ns8y0eZYAKnjmF/y5DcX+fVQ8obz8e/eI+wAjegkwwnZR35537stWuOPe9PzPHZmq tbV04G7ei/R3HgvG3ij65xXb4jsIvKh9P2XyShgh+4FKO2y00++ROomjoE9zjIdEQRXg dQP2p2tMpPEbF4AV9AT4F4Ot4oxtBQYNQWhmr55PeuR1q+gg6deCKCvJFDeAEx/xsiUG 8GsNiik7TkLatXaWdqjULUw2ByLvF079MRF5PLDHic20achJbdlEn/M1pk1X+c4Bp+7q 28AQ== X-Gm-Message-State: AFqh2kptCzK3euG8zhw1cm6EieGTeMqmnRyFJlzcCmIQs+x7h6NSqn8s OBfYOD2ZPlaKZmlQldvU42Mr1cETZHs= X-Google-Smtp-Source: AMrXdXs/yULLvHZ1m4sxIFR+LsQUbwP0XdkRtwVNRPtRUjOjUg5UHrfZqwcs+gPh0wd9nc4kIUrtdg== X-Received: by 2002:ac8:128b:0:b0:3a5:758d:8f5e with SMTP id y11-20020ac8128b000000b003a5758d8f5emr55056038qti.19.1672676733261; Mon, 02 Jan 2023 08:25:33 -0800 (PST) Received: from lvdi-01-iad-l.blue.trinitycyber.com ([38.142.224.194]) by smtp.gmail.com with ESMTPSA id u2-20020ac80502000000b003a81eef14efsm17678091qtg.45.2023.01.02.08.25.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2023 08:25:32 -0800 (PST) From: Ben Magistro To: dev@dpdk.org, stephen@networkplumber.org Cc: ben.magistro@trinitycyber.com, Ben Magistro , stable@dpdk.org Subject: [PATCH 2/6] app/dumpcap: fix storing port identifier Date: Mon, 2 Jan 2023 16:24:37 +0000 Message-Id: <20230102162441.6205-2-koncept1@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230102162441.6205-1-koncept1@gmail.com> References: <20230102162441.6205-1-koncept1@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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); -- 2.27.0