From: Neil Horman Subject: Re: [PATCH] Fix librte_pmd_pcap driver double stop error Date: Mon, 29 Sep 2014 10:24:06 -0400 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-Transfer-Encoding: quoted-printable Cc: dev-VfR2kkLFssw@public.gmane.org To: =?iso-8859-1?Q?Nicol=E1s?= Pernas Maradei Return-path: Content-Disposition: inline In-Reply-To: <1410380225-13751-1-git-send-email-nico-M3NBUjLqch7QT0dZR+AlfA@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Wed, Sep 10, 2014 at 05:17:05PM -0300, Nicol=C3=A1s Pernas Maradei wro= te: > From: Nicola=CC=81s Pernas Maradei >=20 > librte_pmd_pcap driver was opening the pcap/interfaces only at init tim= e 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 thr= ow an > error causing a segfault if the closed pcaps/interfaces were closed aga= in. > 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). >=20 > Signed-off-by: Nicola=CC=81s 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 sur= e 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