X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Ffile.c;h=31086af84cf04431f2bbafa3257d5997a39fddff;hb=d0d15d58c679d4a5ebbdf9a1dd5788782d4dc49d;hp=97359d0359b34c7dd05028a8214d22aab7f4c37d;hpb=d171b5846f4988e66c45a6ed5998bbaef82571f9;p=openvswitch diff --git a/ovsdb/file.c b/ovsdb/file.c index 97359d03..31086af8 100644 --- a/ovsdb/file.c +++ b/ovsdb/file.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009 Nicira Networks +/* Copyright (c) 2009, 2010 Nicira Networks * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -254,15 +254,17 @@ ovsdb_file_replica_change_cb(const struct ovsdb_row *old, } else { struct shash_node *node; - row = NULL; + row = old ? NULL : json_object_create(); SHASH_FOR_EACH (node, &new->table->schema->columns) { const struct ovsdb_column *column = node->data; const struct ovsdb_type *type = &column->type; unsigned int idx = column->index; if (idx != OVSDB_COL_UUID && column->persistent - && (!old || !ovsdb_datum_equals(&old->fields[idx], - &new->fields[idx], type))) + && (old + ? !ovsdb_datum_equals(&old->fields[idx], &new->fields[idx], + type) + : !ovsdb_datum_is_default(&new->fields[idx], type))) { if (!row) { row = json_object_create();