From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id E5C676A96 for ; Mon, 29 Sep 2014 16:17:39 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XYbry-00046a-TB; Mon, 29 Sep 2014 10:24:14 -0400 Date: Mon, 29 Sep 2014 10:24:06 -0400 From: Neil Horman To: =?iso-8859-1?Q?Nicol=E1s?= Pernas Maradei Message-ID: <20140929142406.GC26483@hmsreliant.think-freely.org> References: <1410380225-13751-1-git-send-email-nico@emutex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1410380225-13751-1-git-send-email-nico@emutex.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] Fix librte_pmd_pcap driver double stop error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2014 14:17:40 -0000 On Wed, Sep 10, 2014 at 05:17:05PM -0300, Nicolás Pernas Maradei wrote: > From: Nicolás Pernas Maradei > > librte_pmd_pcap driver was opening the pcap/interfaces only at init time and > closing them only when the port was being stopped. This behaviour would cause > problems (leading to segfault) if the user closed the port 2 times. The first > time the pcap/interfaces would be normally closed but libpcap would throw an > error causing a segfault if the closed pcaps/interfaces were closed again. > This behaviour is solved by re-openning pcaps/interfaces when the port is > started (only if these weren't open already for example at init time). > > Signed-off-by: Nicolás Pernas Maradei This patch assigns pointers to strings that are allocated in the devargs_list. Given that there exists an api interface free_devargs_list(), I'm not sure that whats being done here is consistently safe. It seems like you should dup the strings to make sure you always have the storage allocated, or find some other method to store the needed information. Neil