mon: Set MForward::client_caps explicitly; this fixes a bad connection deref.

Previously the decoded PaxosServiceMessage would attempt to follow an
uninitialized Connection* and segfault the system.
This commit is contained in:
Greg Farnum 2010-03-25 12:58:14 -07:00
parent 213ffe2079
commit 8d9f4fa227
2 changed files with 5 additions and 1 deletions

View File

@ -35,6 +35,10 @@ struct MForward : public Message {
client = m->get_source_inst();
client_caps = m->get_session()->caps;
}
MForward(PaxosServiceMessage *m, MonCaps caps) :
Message(MSG_FORWARD), msg(m), client_caps(caps) {
client = m->get_source_inst();
}
~MForward() {
delete msg;

View File

@ -487,7 +487,7 @@ void Monitor::resend_routed_requests()
PaxosServiceMessage *req = (PaxosServiceMessage *)decode_message(q);
dout(10) << " resend to mon" << mon << " tid " << rr->tid << " " << *req << dendl;
MForward *forward = new MForward(req);
MForward *forward = new MForward(req, rr->session->caps);
forward->set_priority(req->get_priority());
messenger->send_message(forward, monmap->get_inst(mon));
}