The generic interface shouldn't reference specifics like that.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
* believes to be its own.
*/
const entity_addr_t& get_myaddr() { return my_inst.addr; }
- virtual void set_ip(entity_addr_t &addr) = 0;
+ /**
+ * Set the unknown address components for this Messenger.
+ * This is useful if the Messenger doesn't know its full address just by
+ * binding, but another Messenger on the same interface has already learned
+ * its full address. This function does not fill in known address elements,
+ * cause a rebind, or do anything of that sort.
+ *
+ * @param addr The address to use as a template.
+ */
+ virtual void set_addr_unknowns(entity_addr_t &addr) = 0;
const entity_inst_t& get_myinst() { return my_inst; }
/**
* If my_inst.addr doesn't have an IP set, this function
* will fill it in from the passed addr. Otherwise it does nothing and returns.
*/
-void SimpleMessenger::set_ip(entity_addr_t &addr)
+void SimpleMessenger::set_addr_unknowns(entity_addr_t &addr)
{
if (my_inst.addr.is_blank_ip()) {
int port = my_inst.addr.get_port();
*
* @param addr The IP address to set internally.
*/
- void set_ip(entity_addr_t& addr);
+ void set_addr_unknowns(entity_addr_t& addr);
/**
* Retrieve the Connection for an endpoint.
*
int port = cluster_addr.get_port();
cluster_addr = client_messenger->get_myaddr();
cluster_addr.set_port(port);
- cluster_messenger->set_ip(cluster_addr);
+ cluster_messenger->set_addr_unknowns(cluster_addr);
dout(10) << " assuming cluster_addr ip matches client_addr" << dendl;
}
entity_addr_t hb_addr = hbserver_messenger->get_myaddr();
int port = hb_addr.get_port();
hb_addr = cluster_addr;
hb_addr.set_port(port);
- hbserver_messenger->set_ip(hb_addr);
+ hbserver_messenger->set_addr_unknowns(hb_addr);
dout(10) << " assuming hb_addr ip matches cluster_addr" << dendl;
}
MOSDBoot *mboot = new MOSDBoot(superblock, hb_addr, cluster_addr);