ifcfg-rh: add 'timestamp' property before comparing a reread connection

Since ifcfg-rh doesn't write out to file the 'connection.timestamp' property
let's add it before comparing an updated connection with the plugin's reread
one otherwise the comparison operation would always fail.
The fix is not necessary for the keyfile plugin, because the reader/writer
correctly reads/writes the connection timestamp.
This commit is contained in:
Antonio Cardace 2020-03-12 19:04:04 +01:00
parent fc8784a011
commit fcbef9b6d3

View file

@ -3254,6 +3254,11 @@ nms_ifcfg_rh_writer_write_connection (NMConnection *connection,
_LOGW ("write: failure to re-read connection \"%s\": %s",
svFileGetName (ifcfg), "connection is unhandled");
} else {
/* ifcfg-rh doesn't support the 'timestamp' property, let's add it here */
g_object_set (nm_connection_get_setting_connection (reread),
NM_SETTING_CONNECTION_TIMESTAMP,
nm_setting_connection_get_timestamp (nm_connection_get_setting_connection (connection)),
NULL);
if (out_reread_same) {
reread_same = nm_connection_compare (reread, connection, NM_SETTING_COMPARE_FLAG_EXACT);
if (!reread_same) {