Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of GetFabricIndex was broken in session handle refactor #13396

Closed
bzbarsky-apple opened this issue Jan 8, 2022 · 1 comment · Fixed by #14904
Closed

Use of GetFabricIndex was broken in session handle refactor #13396

bzbarsky-apple opened this issue Jan 8, 2022 · 1 comment · Fixed by #14904

Comments

@bzbarsky-apple
Copy link
Contributor

Problem

#13330 replaced code like this:

    return mpExchangeCtx->GetSessionHandle().GetFabricIndex();

with code like this:

    return mpExchangeCtx->GetSessionHandle()->AsSecureSession()->GetFabricIndex();

at a large number of callsites.

Unfortunately, the latter will crash if the session is a group session, whereas the former worked correctly in that case.

Proposed Solution

Fix things so we don't crash if someone groupcasts a command that cares about the fabric index. In practice this probably means moving mFabricIndex up to Session, having it initialized to 0 for UnauthenticatedSession, initializing it correctly for group and secure sessions, and implementing GetFabricIndex on Session. Or is there a reason that can't happen?

@kghost @andreilitvin @msandstedt

@msandstedt
Copy link
Contributor

Proposed Solution

Fix things so we don't crash if someone groupcasts a command that cares about the fabric index. In practice this probably means moving mFabricIndex up to Session, having it initialized to 0 for UnauthenticatedSession, initializing it correctly for group and secure sessions, and implementing GetFabricIndex on Session. Or is there a reason that can't happen?

I think this makes sense. Fabric index 0 is our special reserved value for no-fabric, so it's exactly for this type of thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants