[ovs-dev] [VLAN splinters 12/16] ovsdb-idl: Add assertion for synthetic records in ovsdb_idl_read().

Ethan Jackson ethan at nicira.com
Wed Nov 23 19:39:43 UTC 2011


Looks good.

Ethan

On Tue, Nov 15, 2011 at 17:17, Ben Pfaff <blp at nicira.com> wrote:
> This function doesn't support synthetic records but it probably isn't
> obvious from looking at it, so add an actual assertion.
> ---
>  lib/ovsdb-idl.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
> index 439a40a..19ae16f 100644
> --- a/lib/ovsdb-idl.c
> +++ b/lib/ovsdb-idl.c
> @@ -1112,8 +1112,13 @@ const struct ovsdb_datum *
>  ovsdb_idl_read(const struct ovsdb_idl_row *row,
>                const struct ovsdb_idl_column *column)
>  {
> -    const struct ovsdb_idl_table_class *class = row->table->class;
> -    size_t column_idx = column - class->columns;
> +    const struct ovsdb_idl_table_class *class;
> +    size_t column_idx;
> +
> +    assert(!ovsdb_idl_row_is_synthetic(row));
> +
> +    class = row->table->class;
> +    column_idx = column - class->columns;
>
>     assert(row->new != NULL);
>     assert(column_idx < class->n_columns);
> --
> 1.7.4.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list