mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
ctdb-daemon: Compare interface pointers instead of using strcmp(3)
If the interfaces have different names then they are different interfaces. Also, move assignment of new_name just above where is is first used. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
a66072efdf
commit
a2abc78c87
@ -655,9 +655,7 @@ static int32_t ctdb_do_updateip(struct ctdb_context *ctdb,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
new_name = ctdb_vnn_iface_string(vnn);
|
if (old == vnn->iface) {
|
||||||
if (old_name != NULL && new_name != NULL &&
|
|
||||||
strcmp(old_name, new_name) == 0) {
|
|
||||||
/* A benign update from one interface onto itself.
|
/* A benign update from one interface onto itself.
|
||||||
* no need to run the eventscripts in this case, just return
|
* no need to run the eventscripts in this case, just return
|
||||||
* success.
|
* success.
|
||||||
@ -676,6 +674,7 @@ static int32_t ctdb_do_updateip(struct ctdb_context *ctdb,
|
|||||||
vnn->update_in_flight = true;
|
vnn->update_in_flight = true;
|
||||||
talloc_set_destructor(state, ctdb_updateip_destructor);
|
talloc_set_destructor(state, ctdb_updateip_destructor);
|
||||||
|
|
||||||
|
new_name = ctdb_vnn_iface_string(vnn);
|
||||||
DEBUG(DEBUG_NOTICE,("Update of IP %s/%u from "
|
DEBUG(DEBUG_NOTICE,("Update of IP %s/%u from "
|
||||||
"interface %s to %s\n",
|
"interface %s to %s\n",
|
||||||
ctdb_addr_to_str(&vnn->public_address),
|
ctdb_addr_to_str(&vnn->public_address),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user