[ovs-dev] [VLAN splinters 12/16] ovsdb-idl: Add assertion for synthetic records in ovsdb_idl_read().
Ben Pfaff
blp at nicira.com
Wed Nov 16 01:17:10 UTC 2011
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
More information about the dev
mailing list