Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-02-13 Thread Ben Pfaff
On Thu, Jan 29, 2015 at 07:48:38AM +0900, Simon Horman wrote: > On Wed, Jan 28, 2015 at 11:33:05PM +0100, Thomas Graf wrote: > > On 01/28/15 at 01:22pm, Ben Pfaff wrote: > > > Are you sure? What *gms points to, that is, **gms, is freed, but *gms > > > should still point to the same location. list

[ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty.

2015-02-13 Thread Ben Pfaff
Previously, list_moved() only worked with non-empty lists, but this was a caveat that was really easy to miss. parse_ofp_group_mod_file() had a bug because it didn't honor that restriction. This commit fixes the problem, by modifying the list_moved() interface to be harder to use incorrectly and

Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-28 Thread Simon Horman
On Wed, Jan 28, 2015 at 11:33:05PM +0100, Thomas Graf wrote: > On 01/28/15 at 01:22pm, Ben Pfaff wrote: > > Are you sure? What *gms points to, that is, **gms, is freed, but *gms > > should still point to the same location. list_moved() never > > dereferences 'orig', only compares it against list-

Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-28 Thread Thomas Graf
On 01/28/15 at 01:22pm, Ben Pfaff wrote: > Are you sure? What *gms points to, that is, **gms, is freed, but *gms > should still point to the same location. list_moved() never > dereferences 'orig', only compares it against list->next. In a very > language-lawyer way, working with a pointer to fr

Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-28 Thread Ben Pfaff
On Tue, Jan 27, 2015 at 09:22:00AM +0900, Simon Horman wrote: > Hi Ben, Hi Thomas, > > On Mon, Jan 26, 2015 at 11:19:53AM -0800, Ben Pfaff wrote: > > On Mon, Jan 26, 2015 at 02:44:07PM +0100, Thomas Graf wrote: > > > On 01/26/15 at 05:30pm, Simon Horman wrote: > > > > On Mon, Jan 26, 2015 at 04:40

Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-27 Thread Thomas Graf
On 01/27/15 at 09:22am, Simon Horman wrote: > Hi Ben, Hi Thomas, > > On Mon, Jan 26, 2015 at 11:19:53AM -0800, Ben Pfaff wrote: > > On Mon, Jan 26, 2015 at 02:44:07PM +0100, Thomas Graf wrote: > > > list_moved() not handling the list_empty() case is somewhat rude. > > > Why not just handle that sp

Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-26 Thread Simon Horman
Hi Ben, Hi Thomas, On Mon, Jan 26, 2015 at 11:19:53AM -0800, Ben Pfaff wrote: > On Mon, Jan 26, 2015 at 02:44:07PM +0100, Thomas Graf wrote: > > On 01/26/15 at 05:30pm, Simon Horman wrote: > > > On Mon, Jan 26, 2015 at 04:40:49PM +0900, Simon Horman wrote: > > > > * Although somewhat cure the appr

Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-26 Thread Ben Pfaff
On Mon, Jan 26, 2015 at 02:44:07PM +0100, Thomas Graf wrote: > On 01/26/15 at 05:30pm, Simon Horman wrote: > > On Mon, Jan 26, 2015 at 04:40:49PM +0900, Simon Horman wrote: > > > * Although somewhat cure the approach of setting the next field to NULL > > > > s/cure/crude/ > > > > > seems far le

Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-26 Thread Thomas Graf
On 01/26/15 at 05:30pm, Simon Horman wrote: > On Mon, Jan 26, 2015 at 04:40:49PM +0900, Simon Horman wrote: > > * Although somewhat cure the approach of setting the next field to NULL > > s/cure/crude/ > > > seems far less dangerous than trying to update the list infrastructure > > to handle

Re: [ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-26 Thread Simon Horman
On Mon, Jan 26, 2015 at 04:40:49PM +0900, Simon Horman wrote: > list_moved() appears to only work reliably if its argument is a non-empty > list. This is because list_moved dereferences the next and prev fields > of the list, which for an empty list are the address of the list itself, > and list_mo

[ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

2015-01-25 Thread Simon Horman
list_moved() appears to only work reliably if its argument is a non-empty list. This is because list_moved dereferences the next and prev fields of the list, which for an empty list are the address of the list itself, and list_moved() is intended to be called when the address of the list has change