msgr: use get_myaddr and set_myaddr to set the nonce

We can't set it directly via get_myaddr as its a const ref. Dur.

Signed-off-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
Greg Farnum 2012-11-21 11:47:55 -08:00
parent 5c27bc42ba
commit 820911b265

View File

@ -140,7 +140,9 @@ int Accepter::bind(const entity_addr_t &bind_addr, int avoid_port1, int avoid_po
if (msgr->get_myaddr().get_port() == 0) {
msgr->set_myaddr(listen_addr);
}
msgr->get_myaddr().nonce = nonce;
entity_addr_t addr = msgr->get_myaddr();
addr.nonce = nonce;
msgr->set_myaddr(addr);
msgr->init_local_connection();