Synthetic rows lack a lot of important metadata that the IDL adds to rows
actually obtained from the database, and it's impractical to add that
metadata to synthetic rows. This means that the IDL functions to modify
these rows dereference null pointers and segfault. So, it's really
important not to pass synthetic rows to such functions. However, we've
screwed this up a number of times now and in the end it seems that it's
probably better to just ignore attempts to modify these rows. This commit
implements that.
Feature #8013.
Reported-by: Ethan Jackson <ethan@nicira.com>
struct ovsdb_datum *datum)
{
struct ovsdb_idl_row *row = (struct ovsdb_idl_row *) row_;
struct ovsdb_datum *datum)
{
struct ovsdb_idl_row *row = (struct ovsdb_idl_row *) row_;
- 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;
+
+ if (ovsdb_idl_row_is_synthetic(row)) {
+ return;
+ }
+
+ class = row->table->class;
+ column_idx = column - class->columns;
assert(row->new != NULL);
assert(column_idx < class->n_columns);
assert(row->new != NULL);
assert(column_idx < class->n_columns);
const struct ovsdb_idl_column *column)
{
struct ovsdb_idl_row *row = (struct ovsdb_idl_row *) row_;
const struct ovsdb_idl_column *column)
{
struct ovsdb_idl_row *row = (struct ovsdb_idl_row *) row_;
- 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;
+
+ if (ovsdb_idl_row_is_synthetic(row)) {
+ return;
+ }
+
+ class = row->table->class;
+ column_idx = column - class->columns;
assert(row->new != NULL);
assert(row->old == NULL ||
assert(row->new != NULL);
assert(row->old == NULL ||
{
struct ovsdb_idl_row *row = (struct ovsdb_idl_row *) row_;
{
struct ovsdb_idl_row *row = (struct ovsdb_idl_row *) row_;
+ if (ovsdb_idl_row_is_synthetic(row)) {
+ return;
+ }
+
assert(row->new != NULL);
if (!row->old) {
ovsdb_idl_row_unparse(row);
assert(row->new != NULL);
if (!row->old) {
ovsdb_idl_row_unparse(row);