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 18AF4A00C2 for ; Wed, 4 Jan 2023 04:38:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D16A42D20; Wed, 4 Jan 2023 04:38:23 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 3161642B8E for ; Wed, 4 Jan 2023 04:38:20 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso37805110pjt.0 for ; Tue, 03 Jan 2023 19:38:19 -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:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ex5rV++63MUgg7vuwjiHzkM6W+NgA72iBtEK3leuCfM=; b=Uzf8cRO/ac1+8yiZQZ92034eMyeuT18bb0HeNK4BTya5wHFsj7aUvi3c2UcNPtiLmV 3o0harlJonxZBjYwiUYcMwPptU4779p7MlhWmGVNWbh/mc4imDomZgvpfjZN65HPTJYT KZCJIPT3Tf3emAXj/GlSPl0duBBRZ/ajCiR1prt3elzdKJk7juKaS+PtvI0HJIHn8vEp b6CyXqsUq1DCJW7WzGxd/k2yBJhF9Ucr02RaOLabx7uajVfdEZFuODwL3fWFh6jP+fmr Cbu3skP1/AjnmBjpUo+VJqTyrmSBifcNY5N2GIFgNu1NDZ+rEi665SOrEcaOl7uHalA+ hIVg== 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=Ex5rV++63MUgg7vuwjiHzkM6W+NgA72iBtEK3leuCfM=; b=qRz8qLWRvF0mXpe3rTFJE3naw7tG7Ukd6nQMzrIvaDXBP5QxlkKj6/ljm/lYqu//8k J8Sn9DyAR0me8npvmmW9qVo0zGjiZOt73VXQCvhen5m6ZvDj+dW1UgRWjYsM3FxXso1L Pz1KMkdVFtaE0BXD1glxsd1BMijKDDRbRdSJsHNVPjYmN5dAPFNnYSJAW3rP2h7Q9Ohh B20snxJAxWNDPowpVmB2AMIfvbKrrv+8k/mNaZsG58bHWLxoqicsWv1dTjDlNQCsZlzo 3KMi9FiVgInRJOpyb2VKElpa19r5njRL7g8A7GP1VxfrlWk/HR0MlznIvNO8XS/cJqNk eT+w== X-Gm-Message-State: AFqh2kr+/vmzBYCGj8z1Ax0wF4ZuNShLWD0QO8v01Y+e8HDdN8zTv++F ifivoOvvPKYvy6/JW88kC1e3RQ== X-Google-Smtp-Source: AMrXdXvpk5NV+7tfjM29BPp5lj+HO/CutccaIu+gODZtOrUpNOxUl6XvgTRmG6A0VXdPqsTN7ClDsQ== X-Received: by 2002:a17:902:e74d:b0:189:6d2f:4bcd with SMTP id p13-20020a170902e74d00b001896d2f4bcdmr61920274plf.0.1672803499165; Tue, 03 Jan 2023 19:38:19 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id c10-20020a170903234a00b0017f73caf588sm23091347plh.218.2023.01.03.19.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 19:38:18 -0800 (PST) From: Stephen Hemminger To: Ben Magistro Cc: dev@dpdk.org, stephen@networkplumber.org, stable@dpdk.org Subject: [PATCH v2 1/6] app/dumpcap: fix storing port identifier Date: Tue, 3 Jan 2023 19:38:10 -0800 Message-Id: <20230104033815.35496-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230104033815.35496-1-stephen@networkplumber.org> References: <20230102162441.6205-1-koncept1@gmail.com> <20230104033815.35496-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Ben Magistro 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 Signed-off-by: Stephen Hemminger --- app/dumpcap/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index 2eb8414efaa5..4751ca26b892 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.39.0