Skip to content

Commit 2fb6c04

Browse files
authored
Fix OBSERVED_ADDRESS frame codepoints and make address discovery opt-in (#43)
Two commits against the address discovery extension. 1. Use draft codepoints for OBSERVED_ADDRESS frame types QUIC_FRAME_OBSERVED_ADDRESS_V4/_V6 in src/core/frame.h were 0x9f81/0x9f82, with the draft-ietf-quic-address-discovery codepoints (0x9f81a6/0x9f81a7) left only as a trailing comment. The transport parameter ID (QUIC_TP_ID_OBSERVED_ADDRESS = 0x9f81a176) already matches the draft, so the extension negotiates successfully with other implementations — and only then do the frames themselves fail to parse. Reproduced against noq 1.0.1 (quinn-based, draft codepoints) over loopback: quicsample: Connected -> Shut down by transport, 0x5 (QUIC_STATUS_INTERNAL_ERROR) noq server: aborted by peer: received a frame that was badly formatted src/plugins/dbg/quictypes.h already carried the correct draft values, so the two enums were out of sync. src/core/unittest/SpinFrame.cpp widens FrameType to uint32_t so the case labels stay within the switch operand's range (-Werror=switch-outside-range otherwise fails the build). The fuzzed value is still drawn from the 16-bit space, exactly as before. 2. Add opt-in settings for observed address reports The extension was unconditionally enabled: msquic always advertised the transport parameter, always sent it with a hardcoded value of 2 ("both"), discarded the peer's value (the TODO - Pass value? in crypto_tls.c), and always accepted OBSERVED_ADDRESS frames. An app had no way to turn any of it off. Two new settings, mirroring the noq/quinn API: Setting Default Meaning SendObservedAddressReports FALSE Report the peer's observed address to it ReceiveObservedAddressReports FALSE Ask the peer to report ours The extension is now opt-in. Previously it was always on; both settings default to FALSE. The transport parameter is sent only when at least one direction is enabled, and its value now states which — SEND_ONLY (0) / RECEIVE_ONLY (1) / BOTH (2), per the draft. The peer's value is kept in QUIC_TRANSPORT_PARAMETERS::ObservedAddressRole and honored: frames are sent only when this endpoint enabled sending and the peer asked to receive. An OBSERVED_ADDRESS frame arriving when we never asked to receive one is now a PROTOCOL_VIOLATION instead of being silently accepted. quicsample gains -observed_address_send / -observed_address_recv on both client and server. Plumbed through the usual places: msquic.h (IsSet + Flags bits), msquic.hpp setters, settings.h/settings.c (defaults, copy, apply, registry load, both dumps, to/from-internal), quicdef.h defaults and registry names, docs/Settings.md, SettingsTest SET+GET entries. Clog headers and clog.sidecar were regenerated with the clog tool from submodules/clog. Verification Loopback against noq-mp-sample (unmodified; noq enables both directions), with the rebuilt quicsample: Frame codepoints — before commit 1: Scenario Result quicsample -client -> noq server ❌ Shut down by transport, 0x5 quicsample -client -multipath -> noq server ❌ same noq client -> quicsample -server ✅ (noq client never advertises the TP) After both commits: quicsample client flags Observed Address reports Data exchange none (defaults off) 0 ✅ -observed_address_recv 1 ✅ -observed_address_send 0 (noq honors send-only) ✅ both 1 ✅ -multipath -observed_address_recv 2 (one per path) ✅ msquic-to-msquic behaves the same: a server started with -observed_address_send reports only to a client that passed -observed_address_recv. msquiccoretest: 540 passed, 0 failed (3 pre-existing skips are the Linux-unsupported storage tests). TransportParamTest.ObservedAddress was extended to round-trip all three role values. Notes Because the frame codepoints no longer fit in 16 bits, SpinFrame can no longer generate them, so its OBSERVED_ADDRESS cases become unreachable — the same situation as the existing ADD_ADDRESS/PUNCH_ME_NOW cases. Fuzzing those would need the loop to draw from a table of known frame types rather than rejection-sample a 16-bit space; left out of this change. Rust bindings are updated: src/rs/settings.rs gains the two setters, and linux_bindings.rs was regenerated with cargo build --features overwrite. win_bindings.rs cannot be regenerated on Linux, so the identical hunks were applied by hand — the diffs of the two files match line for line and both parse, but it has not been compiled for a Windows target. Verified with cargo test --features preview-api (13 passed). The C# bindings were not updated; they need their generator re-run. Note they are already missing MultipathEnabled. Only the Linux clog artifacts were regenerated; Windows builds regenerate theirs as part of the build. 🤖 Generated with Claude Code
1 parent 5baf0cc commit 2fb6c04

23 files changed

Lines changed: 715 additions & 248 deletions

docs/Settings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ The following settings are available via registry as well as via [QUIC_SETTINGS]
7070
| Server Initiated Migration | uint8_t | ServerMigrationEnabled | 0 (FALSE) | Enable Server Initiated Migration. |
7171
| ADD_ADDRESS handling mode | uint8_t | AddAddressMode | 0 (AUTO) | Control handling of ADD_ADDRESS Frame |
7272
| IgnoreUnreachable | uint8_t | IgnoreUnreachable | 0 (FALSE) | Ignore Unreachable during the Handshake |
73+
| SendObservedAddressReports | uint8_t | SendObservedAddressReports | 0 (FALSE) | Report the peer's observed address to it via OBSERVED_ADDRESS frames. Frames are only sent if the peer also asked to receive them. |
74+
| ReceiveObservedAddressReports | uint8_t | ReceiveObservedAddressReports | 0 (FALSE) | Ask the peer to report this endpoint's observed address. Reports arrive as `QUIC_CONNECTION_EVENT_NOTIFY_OBSERVED_ADDRESS`. |
7375

7476
The types map to registry types as follows:
7577
- `uint64_t` is a `REG_QWORD`.

src/core/connection.c

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,9 +2110,23 @@ QuicConnGenerateLocalTransportParameters(
21102110
QUIC_TP_FLAG_MAX_ACK_DELAY |
21112111
QUIC_TP_FLAG_MIN_ACK_DELAY |
21122112
QUIC_TP_FLAG_ACTIVE_CONNECTION_ID_LIMIT |
2113-
QUIC_TP_FLAG_OBSERVED_ADDRESS |
21142113
QUIC_TP_FLAG_NAT_TRAVERSE;
21152114

2115+
//
2116+
// The observed_address transport parameter is only sent when at least one
2117+
// direction of the extension is enabled; its value states which.
2118+
//
2119+
if (Connection->Settings.SendObservedAddressReports ||
2120+
Connection->Settings.ReceiveObservedAddressReports) {
2121+
LocalTP->Flags |= QUIC_TP_FLAG_OBSERVED_ADDRESS;
2122+
LocalTP->ObservedAddressRole =
2123+
Connection->Settings.SendObservedAddressReports ?
2124+
(Connection->Settings.ReceiveObservedAddressReports ?
2125+
QUIC_TP_OBSERVED_ADDRESS_ROLE_BOTH :
2126+
QUIC_TP_OBSERVED_ADDRESS_ROLE_SEND_ONLY) :
2127+
QUIC_TP_OBSERVED_ADDRESS_ROLE_RECEIVE_ONLY;
2128+
}
2129+
21162130
if (Connection->Settings.IdleTimeoutMs != 0) {
21172131
LocalTP->Flags |= QUIC_TP_FLAG_IDLE_TIMEOUT;
21182132
LocalTP->IdleTimeout = Connection->Settings.IdleTimeoutMs;
@@ -2769,7 +2783,7 @@ QuicConnProcessPeerTransportParameters(
27692783
UINT32_MAX);
27702784
}
27712785

2772-
if (Connection->PeerTransportParams.Flags & QUIC_TP_FLAG_OBSERVED_ADDRESS) {
2786+
if (QuicConnPeerWantsObservedAddressReports(Connection)) {
27732787
Connection->State.ObservedAddressNegotiated = TRUE;
27742788
QuicSendSetSendFlag(
27752789
&Connection->Send,
@@ -5533,7 +5547,21 @@ QuicConnRecvFrames(
55335547
}
55345548

55355549
case QUIC_FRAME_OBSERVED_ADDRESS_V4:
5536-
case QUIC_FRAME_OBSERVED_ADDRESS_V6: { // Always accept the frame, because we always enable support.
5550+
case QUIC_FRAME_OBSERVED_ADDRESS_V6: {
5551+
if (!Connection->Settings.ReceiveObservedAddressReports) {
5552+
//
5553+
// We never asked to receive these reports, so the peer isn't
5554+
// allowed to send them.
5555+
//
5556+
QuicTraceEvent(
5557+
ConnError,
5558+
"[conn][%p] ERROR, %s.",
5559+
Connection,
5560+
"Received OBSERVED_ADDRESS frame when not negotiated");
5561+
QuicConnTransportError(Connection, QUIC_ERROR_PROTOCOL_VIOLATION);
5562+
return FALSE;
5563+
}
5564+
55375565
QUIC_OBSERVED_ADDRESS_EX Frame;
55385566
if (!QuicObservedAddressFrameDecode(FrameType, PayloadLength, Payload, &Offset, &Frame)) {
55395567
QuicTraceEvent(
@@ -9542,7 +9570,7 @@ QuicConnApplyNewSettings(
95429570
QuicConnIndicateEvent(Connection, &Event);
95439571
}
95449572

9545-
if (QuicConnIsServer(Connection) && Connection->PeerTransportParams.Flags & QUIC_TP_FLAG_OBSERVED_ADDRESS) {
9573+
if (QuicConnIsServer(Connection) && QuicConnPeerWantsObservedAddressReports(Connection)) {
95469574
Connection->State.ObservedAddressNegotiated = TRUE;
95479575
QuicSendSetSendFlag(
95489576
&Connection->Send,

src/core/connection.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,23 @@ QuicConnIsServer(
792792
return ((QUIC_HANDLE*)Connection)->Type == QUIC_HANDLE_TYPE_CONNECTION_SERVER;
793793
}
794794

795+
//
796+
// Helper to determine if observed address reports should be sent to the peer:
797+
// this endpoint must be willing to send them, and the peer must have asked to
798+
// receive them.
799+
//
800+
QUIC_INLINE
801+
BOOLEAN
802+
QuicConnPeerWantsObservedAddressReports(
803+
_In_ const QUIC_CONNECTION * const Connection
804+
)
805+
{
806+
return
807+
Connection->Settings.SendObservedAddressReports &&
808+
(Connection->PeerTransportParams.Flags & QUIC_TP_FLAG_OBSERVED_ADDRESS) &&
809+
QUIC_TP_OBSERVED_ADDRESS_ROLE_RECEIVES(Connection->PeerTransportParams.ObservedAddressRole);
810+
}
811+
795812
//
796813
// Helper to determine if a connection is client side.
797814
//

src/core/crypto_tls.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ QuicCryptoTlsEncodeTransportParameters(
912912
RequiredTPLen +=
913913
TlsTransportParamLength(
914914
QUIC_TP_ID_OBSERVED_ADDRESS,
915-
QuicVarIntSize(2)); // Hardcode for now
915+
QuicVarIntSize(TransportParams->ObservedAddressRole));
916916
}
917917
if (TransportParams->Flags & QUIC_TP_FLAG_NAT_TRAVERSE) {
918918
if (IsServerTP) {
@@ -1285,13 +1285,13 @@ QuicCryptoTlsEncodeTransportParameters(
12851285
TPBuf =
12861286
TlsWriteTransportParamVarInt(
12871287
QUIC_TP_ID_OBSERVED_ADDRESS,
1288-
2,
1288+
TransportParams->ObservedAddressRole,
12891289
TPBuf);
12901290
QuicTraceLogConnVerbose(
12911291
EncodeTPObservedAddress,
12921292
Connection,
12931293
"TP: Observed Address (%u)",
1294-
2);
1294+
(uint32_t)TransportParams->ObservedAddressRole);
12951295
}
12961296
if (TransportParams->Flags & QUIC_TP_FLAG_NAT_TRAVERSE) {
12971297
if (IsServerTP) {
@@ -2095,7 +2095,7 @@ QuicCryptoTlsDecodeTransportParameters( // NOLINT(readability-function-size, goo
20952095
"Invalid length of QUIC_TP_ID_OBSERVED_ADDRESS");
20962096
goto Exit;
20972097
}
2098-
if (value > 2) {
2098+
if (value > QUIC_TP_OBSERVED_ADDRESS_ROLE_BOTH) {
20992099
QuicTraceEvent(
21002100
ConnError,
21012101
"[conn][%p] ERROR, %s.",
@@ -2108,7 +2108,8 @@ QuicCryptoTlsDecodeTransportParameters( // NOLINT(readability-function-size, goo
21082108
Connection,
21092109
"TP: Observed Address (%u)",
21102110
(uint32_t)value);
2111-
TransportParams->Flags |= QUIC_TP_FLAG_OBSERVED_ADDRESS; // TODO - Pass value?
2111+
TransportParams->Flags |= QUIC_TP_FLAG_OBSERVED_ADDRESS;
2112+
TransportParams->ObservedAddressRole = value;
21122113
break;
21132114
}
21142115

src/core/frame.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ typedef enum QUIC_FRAME_TYPE {
159159
QUIC_FRAME_IMMEDIATE_ACK = 0x1fULL,
160160
/* 0xaf to 0x2f4 are unused currently */
161161
QUIC_FRAME_TIMESTAMP = 0x2f5ULL,
162-
/* 0x2f6 to 0x9f80 are unused currently */
163-
QUIC_FRAME_OBSERVED_ADDRESS_V4 = 0x9f81ULL, // 0x9f81a6ULL,
164-
QUIC_FRAME_OBSERVED_ADDRESS_V6 = 0x9f82ULL, // 0x9f81a7ULL,
162+
/* 0x2f6 to 0x9f81a5 are unused currently */
163+
QUIC_FRAME_OBSERVED_ADDRESS_V4 = 0x9f81a6ULL,
164+
QUIC_FRAME_OBSERVED_ADDRESS_V6 = 0x9f81a7ULL,
165165

166166
QUIC_FRAME_ADD_ADDRESS_V4 = 0x3d7e90LL,
167167
QUIC_FRAME_ADD_ADDRESS_V6 = 0x3d7e91LL,

src/core/quicdef.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,13 @@ CXPLAT_STATIC_ASSERT(
620620
//
621621
#define QUIC_DEFAULT_MULTIPATH_ENABLED FALSE
622622

623+
//
624+
// The default settings for the address discovery extension. Both directions
625+
// are off by default; the app opts in per direction.
626+
//
627+
#define QUIC_DEFAULT_SEND_OBSERVED_ADDRESS_REPORTS FALSE
628+
#define QUIC_DEFAULT_RECEIVE_OBSERVED_ADDRESS_REPORTS FALSE
629+
623630
//
624631
// The number of rounds in Cubic Slow Start to sample RTT.
625632
//
@@ -709,6 +716,21 @@ CXPLAT_STATIC_ASSERT(
709716
//
710717
#define QUIC_TP_MAX_PATH_ID_MAX ((1ULL << 32) - 1)
711718

719+
//
720+
// Values of the observed_address transport parameter, per
721+
// draft-ietf-quic-address-discovery. The value states which directions of the
722+
// extension the endpoint is willing to take part in.
723+
//
724+
#define QUIC_TP_OBSERVED_ADDRESS_ROLE_SEND_ONLY 0
725+
#define QUIC_TP_OBSERVED_ADDRESS_ROLE_RECEIVE_ONLY 1
726+
#define QUIC_TP_OBSERVED_ADDRESS_ROLE_BOTH 2
727+
728+
#define QUIC_TP_OBSERVED_ADDRESS_ROLE_SENDS(Role) \
729+
((Role) == QUIC_TP_OBSERVED_ADDRESS_ROLE_SEND_ONLY || (Role) == QUIC_TP_OBSERVED_ADDRESS_ROLE_BOTH)
730+
731+
#define QUIC_TP_OBSERVED_ADDRESS_ROLE_RECEIVES(Role) \
732+
((Role) == QUIC_TP_OBSERVED_ADDRESS_ROLE_RECEIVE_ONLY || (Role) == QUIC_TP_OBSERVED_ADDRESS_ROLE_BOTH)
733+
712734
/*************************************************************
713735
PERSISTENT SETTINGS
714736
*************************************************************/
@@ -743,6 +765,8 @@ CXPLAT_STATIC_ASSERT(
743765
#define QUIC_SETTING_ADD_ADDRESS_MODE "AddAddressMode"
744766
#define QUIC_SETTING_IGNORE_UNREACHABLE "IgnoreUnreachable"
745767
#define QUIC_SETTING_MULTIPATH_ENABLED "MultipathEnabled"
768+
#define QUIC_SETTING_SEND_OBSERVED_ADDRESS_REPORTS "SendObservedAddressReports"
769+
#define QUIC_SETTING_RECEIVE_OBSERVED_ADDRESS_REPORTS "ReceiveObservedAddressReports"
746770

747771

748772
#define QUIC_SETTING_INITIAL_WINDOW_PACKETS "InitialWindowPackets"

src/core/settings.c

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ QuicSettingsSetDefault(
191191
if (!Settings->IsSet.MultipathEnabled) {
192192
Settings->MultipathEnabled = QUIC_DEFAULT_MULTIPATH_ENABLED;
193193
}
194+
if (!Settings->IsSet.SendObservedAddressReports) {
195+
Settings->SendObservedAddressReports = QUIC_DEFAULT_SEND_OBSERVED_ADDRESS_REPORTS;
196+
}
197+
if (!Settings->IsSet.ReceiveObservedAddressReports) {
198+
Settings->ReceiveObservedAddressReports = QUIC_DEFAULT_RECEIVE_OBSERVED_ADDRESS_REPORTS;
199+
}
194200
}
195201

196202
_IRQL_requires_max_(PASSIVE_LEVEL)
@@ -382,6 +388,12 @@ QuicSettingsCopy(
382388
if (!Destination->IsSet.MultipathEnabled) {
383389
Destination->MultipathEnabled = Source->MultipathEnabled;
384390
}
391+
if (!Destination->IsSet.SendObservedAddressReports) {
392+
Destination->SendObservedAddressReports = Source->SendObservedAddressReports;
393+
}
394+
if (!Destination->IsSet.ReceiveObservedAddressReports) {
395+
Destination->ReceiveObservedAddressReports = Source->ReceiveObservedAddressReports;
396+
}
385397
}
386398

387399
_IRQL_requires_max_(PASSIVE_LEVEL)
@@ -811,6 +823,16 @@ QuicSettingApply(
811823
Destination->IsSet.MultipathEnabled = TRUE;
812824
}
813825

826+
if (Source->IsSet.SendObservedAddressReports && (!Destination->IsSet.SendObservedAddressReports || OverWrite)) {
827+
Destination->SendObservedAddressReports = Source->SendObservedAddressReports;
828+
Destination->IsSet.SendObservedAddressReports = TRUE;
829+
}
830+
831+
if (Source->IsSet.ReceiveObservedAddressReports && (!Destination->IsSet.ReceiveObservedAddressReports || OverWrite)) {
832+
Destination->ReceiveObservedAddressReports = Source->ReceiveObservedAddressReports;
833+
Destination->IsSet.ReceiveObservedAddressReports = TRUE;
834+
}
835+
814836
return TRUE;
815837
}
816838

@@ -1551,6 +1573,26 @@ QuicSettingsLoad(
15511573
&ValueLen);
15521574
Settings->MultipathEnabled = !!Value;
15531575
}
1576+
if (!Settings->IsSet.SendObservedAddressReports) {
1577+
Value = QUIC_DEFAULT_SEND_OBSERVED_ADDRESS_REPORTS;
1578+
ValueLen = sizeof(Value);
1579+
CxPlatStorageReadValue(
1580+
Storage,
1581+
QUIC_SETTING_SEND_OBSERVED_ADDRESS_REPORTS,
1582+
(uint8_t*)&Value,
1583+
&ValueLen);
1584+
Settings->SendObservedAddressReports = !!Value;
1585+
}
1586+
if (!Settings->IsSet.ReceiveObservedAddressReports) {
1587+
Value = QUIC_DEFAULT_RECEIVE_OBSERVED_ADDRESS_REPORTS;
1588+
ValueLen = sizeof(Value);
1589+
CxPlatStorageReadValue(
1590+
Storage,
1591+
QUIC_SETTING_RECEIVE_OBSERVED_ADDRESS_REPORTS,
1592+
(uint8_t*)&Value,
1593+
&ValueLen);
1594+
Settings->ReceiveObservedAddressReports = !!Value;
1595+
}
15541596
}
15551597

15561598
_IRQL_requires_max_(PASSIVE_LEVEL)
@@ -1625,6 +1667,8 @@ QuicSettingsDump(
16251667
QuicTraceLogVerbose(SettingAddAddress, "[sett] AddAddressMode = %hhu", Settings->AddAddressMode);
16261668
QuicTraceLogVerbose(SettingIgnoreUnreachable, "[sett] IgnoreUnreachable = %hhu", Settings->IgnoreUnreachable);
16271669
QuicTraceLogVerbose(SettingMultipathEnabled, "[sett] MultipathEnabled = %hhu", Settings->MultipathEnabled);
1670+
QuicTraceLogVerbose(SettingSendObservedAddressReports, "[sett] SendObservedAddrRpts = %hhu", Settings->SendObservedAddressReports);
1671+
QuicTraceLogVerbose(SettingRecvObservedAddressReports, "[sett] RecvObservedAddrRpts = %hhu", Settings->ReceiveObservedAddressReports);
16281672
}
16291673

16301674
_IRQL_requires_max_(PASSIVE_LEVEL)
@@ -1812,6 +1856,12 @@ QuicSettingsDumpNew(
18121856
if (Settings->IsSet.MultipathEnabled) {
18131857
QuicTraceLogVerbose(SettingMultipathEnabled, "[sett] MultipathEnabled = %hhu", Settings->MultipathEnabled);
18141858
}
1859+
if (Settings->IsSet.SendObservedAddressReports) {
1860+
QuicTraceLogVerbose(SettingSendObservedAddressReports, "[sett] SendObservedAddrRpts = %hhu", Settings->SendObservedAddressReports);
1861+
}
1862+
if (Settings->IsSet.ReceiveObservedAddressReports) {
1863+
QuicTraceLogVerbose(SettingRecvObservedAddressReports, "[sett] RecvObservedAddrRpts = %hhu", Settings->ReceiveObservedAddressReports);
1864+
}
18151865
}
18161866

18171867
#define SETTING_COPY_TO_INTERNAL(Field, Settings, InternalSettings) \
@@ -2117,6 +2167,22 @@ QuicSettingsSettingsToInternal(
21172167
SettingsSize,
21182168
InternalSettings);
21192169

2170+
SETTING_COPY_FLAG_TO_INTERNAL_SIZED(
2171+
Flags,
2172+
SendObservedAddressReports,
2173+
QUIC_SETTINGS,
2174+
Settings,
2175+
SettingsSize,
2176+
InternalSettings);
2177+
2178+
SETTING_COPY_FLAG_TO_INTERNAL_SIZED(
2179+
Flags,
2180+
ReceiveObservedAddressReports,
2181+
QUIC_SETTINGS,
2182+
Settings,
2183+
SettingsSize,
2184+
InternalSettings);
2185+
21202186
return QUIC_STATUS_SUCCESS;
21212187
}
21222188

@@ -2334,6 +2400,22 @@ QuicSettingsGetSettings(
23342400
*SettingsLength,
23352401
InternalSettings);
23362402

2403+
SETTING_COPY_FLAG_FROM_INTERNAL_SIZED(
2404+
Flags,
2405+
SendObservedAddressReports,
2406+
QUIC_SETTINGS,
2407+
Settings,
2408+
*SettingsLength,
2409+
InternalSettings);
2410+
2411+
SETTING_COPY_FLAG_FROM_INTERNAL_SIZED(
2412+
Flags,
2413+
ReceiveObservedAddressReports,
2414+
QUIC_SETTINGS,
2415+
Settings,
2416+
*SettingsLength,
2417+
InternalSettings);
2418+
23372419
*SettingsLength = CXPLAT_MIN(*SettingsLength, sizeof(QUIC_SETTINGS));
23382420

23392421
return QUIC_STATUS_SUCCESS;

src/core/settings.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ typedef struct QUIC_SETTINGS_INTERNAL {
6969
uint64_t AddAddressMode : 1;
7070
uint64_t IgnoreUnreachable : 1;
7171
uint64_t MultipathEnabled : 1;
72-
uint64_t RESERVED : 9;
72+
uint64_t SendObservedAddressReports : 1;
73+
uint64_t ReceiveObservedAddressReports : 1;
74+
uint64_t RESERVED : 7;
7375
} IsSet;
7476
};
7577

@@ -127,6 +129,8 @@ typedef struct QUIC_SETTINGS_INTERNAL {
127129
uint8_t AddAddressMode : 2; // QUIC_ADD_ADDRESS_MODE
128130
uint8_t IgnoreUnreachable : 1;
129131
uint8_t MultipathEnabled : 1;
132+
uint8_t SendObservedAddressReports : 1;
133+
uint8_t ReceiveObservedAddressReports : 1;
130134
uint8_t MtuDiscoveryMissingProbeCount;
131135
} QUIC_SETTINGS_INTERNAL;
132136

src/core/transport_params.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ typedef struct QUIC_TRANSPORT_PARAMETERS {
160160
_Field_range_(0, QUIC_TP_MAX_PATH_ID_MAX)
161161
QUIC_VAR_INT InitialMaxPathId;
162162

163+
//
164+
// The role advertised by the observed_address transport parameter. Only
165+
// meaningful when QUIC_TP_FLAG_OBSERVED_ADDRESS is set.
166+
//
167+
_Field_range_(0, QUIC_TP_OBSERVED_ADDRESS_ROLE_BOTH)
168+
QUIC_VAR_INT ObservedAddressRole;
169+
163170
} QUIC_TRANSPORT_PARAMETERS;
164171

165172
//

src/core/unittest/SettingsTest.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ TEST(SettingsTest, TestAllSettingsFieldsSet)
133133
SETTINGS_FEATURE_SET_TEST(AddAddressMode, QuicSettingsSettingsToInternal);
134134
SETTINGS_FEATURE_SET_TEST(IgnoreUnreachable, QuicSettingsSettingsToInternal);
135135
SETTINGS_FEATURE_SET_TEST(MultipathEnabled, QuicSettingsSettingsToInternal);
136+
SETTINGS_FEATURE_SET_TEST(SendObservedAddressReports, QuicSettingsSettingsToInternal);
137+
SETTINGS_FEATURE_SET_TEST(ReceiveObservedAddressReports, QuicSettingsSettingsToInternal);
136138

137139
// Bias field count on behalf of erstwhile ReservedRioEnabled
138140
FieldCount++;
@@ -228,6 +230,8 @@ TEST(SettingsTest, TestAllSettingsFieldsGet)
228230
SETTINGS_FEATURE_GET_TEST(AddAddressMode, QuicSettingsGetSettings);
229231
SETTINGS_FEATURE_GET_TEST(IgnoreUnreachable, QuicSettingsGetSettings);
230232
SETTINGS_FEATURE_GET_TEST(MultipathEnabled, QuicSettingsGetSettings);
233+
SETTINGS_FEATURE_GET_TEST(SendObservedAddressReports, QuicSettingsGetSettings);
234+
SETTINGS_FEATURE_GET_TEST(ReceiveObservedAddressReports, QuicSettingsGetSettings);
231235

232236
// Bias field count on behalf of erstwhile ReservedRioEnabled
233237
FieldCount++;

0 commit comments

Comments
 (0)