These are currently converted to strings constantly in log messages
and other places. This clutters the code and probably has a minor
performance impact.
Add a new string field to the VNN structure. Populate it when a
public address is added and the VNN structure is allocated. This is
consistent with how node addresses are handled.
Don't use it yet, or this commit becomes huge.
A short-term goal is that each VNN public address will be converted to
a string only once. A longer-term goal is to reduce use of
ctdb_addr_to_str().
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
struct vnn_interface *ifaces;
ctdb_sock_addr public_address;
uint8_t public_netmask_bits;
+ const char *name;
/*
* The node number that is serving this public address - set
DBG_ERR("Memory allocation error\n");
return -1;
}
+
+ vnn->name = ctdb_sock_addr_to_string(vnn, addr, false);
+ if (vnn->name == NULL) {
+ DBG_ERR("Memory allocation error\n");
+ talloc_free(vnn);
+ return -1;
+ }
+
tmp = talloc_strdup(vnn, ifaces);
if (tmp == NULL) {
DBG_ERR("Memory allocation error\n");