Open Bug 1693996 Opened 4 years ago Updated 4 years ago

In mode 1, 4, and 5, TRR_ONLY_MODE set on the request results in fallback

Categories

(Core :: Networking: DNS, defect, P3)

defect

Tracking

()

People

(Reporter: nhnt11, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

This was surprising to me - what's happening is that we set the effective TRR mode of the request to TRR_DISABLED_MODE, because the global mode is TRROFF[0]. Then, in the logic for fallback, we see that the effective TRR mode is TRR_DISABLED_MODE, and we do the native lookup[1].

I'd imagine that TRR_ONLY_MODE should obviously not use TRR when the global mode is TRROFF, but also shouldn't fall back - resulting in an error. Right now the meaning of the flag seems to be "Treat the request as mode 3 if the global mode is 2 or 3, treat the request as mode 0 if the global mode is 5 (or 1 or 4), otherwise fail the lookup (global mode 0)" which doesn't make much sense to me. I think it should mean "Treat the request as mode 3 if the global mode is 2 or 3, otherwise fail the lookup"

[0] https://searchfox.org/mozilla-central/rev/755eac870f4c617077821d873902d8d82be6d50c/netwerk/dns/nsHostResolver.cpp#1562-1566
[1] https://searchfox.org/mozilla-central/rev/755eac870f4c617077821d873902d8d82be6d50c/netwerk/dns/nsHostResolver.cpp#1654

TRR_ONLY_MODE for requests isn't really used much, so this is not high priority.
The reasoning behind this mode was that it might be used if we had TRR-only containers or private browsing windows - so everything would be in mode0 or mode2, except for one window, which would run in mode3.
If the user set the browser to mode5, arguably we should not use TRR at all, but for usability concerns, we should not fail them also.

So the reasoning is: treat this request as mode3 if the global mode is 0, 2 or 3.

Severity: -- → S3
Priority: -- → P3
Whiteboard: [necko-triaged]

(In reply to Valentin Gosu [:valentin] (he/him) from comment #1)

TRR_ONLY_MODE for requests isn't really used much, so this is not high priority.

Agreed. Thanks for triaging.

The reasoning behind this mode was that it might be used if we had TRR-only containers or private browsing windows - so everything would be in mode0 or mode2, except for one window, which would run in mode3.
If the user set the browser to mode5, arguably we should not use TRR at all, but for usability concerns, we should not fail them also.

So the reasoning is: treat this request as mode3 if the global mode is 0, 2 or 3.

Fair enough, but in that case I'd propose we change this to "TRR_UPGRADE_MODE" or something. Thanks for clarifying, I was quite surprised when tinkering with the tests.

You need to log in before you can comment on or make changes to this bug.