v29.4-roots.3 · Commit 3: [PATCH 03/30] policy: restore conservative relay and network controls
src/test/fuzz/util/net.h
Before: src/test/fuzz/util/net.h · After: src/test/fuzz/util/net.h
File metadata
index 698001a7f15ed8204809d6b28f81942980a78dca..381103aa8b6ec88da11b569ffe20f17233220621 100644
Download original patch · Release notes
Diff rows 1–22 of 22. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/test/fuzz/util/net.h
CHANGED
|
@@ -239,6 +239,8 @@ auto ConsumeNode(FuzzedDataProvider& fuzzed_data_provider, const std::optional<N
|
|
| 239 |
const std::string addr_name = fuzzed_data_provider.ConsumeRandomLengthString(64);
|
| 240 |
const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray(ALL_CONNECTION_TYPES);
|
| 241 |
const bool inbound_onion{conn_type == ConnectionType::INBOUND ? fuzzed_data_provider.ConsumeBool() : false};
|
|
|
|
|
|
|
| 242 |
NetPermissionFlags permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
|
| 243 |
if constexpr (ReturnUniquePtr) {
|
| 244 |
return std::make_unique<CNode>(node_id,
|
|
@@ -250,6 +252,7 @@ auto ConsumeNode(FuzzedDataProvider& fuzzed_data_provider, const std::optional<N
|
|
| 250 |
addr_name,
|
| 251 |
conn_type,
|
| 252 |
inbound_onion,
|
|
|
|
| 253 |
CNodeOptions{ .permission_flags = permission_flags });
|
| 254 |
} else {
|
| 255 |
return CNode{node_id,
|
|
@@ -261,6 +264,7 @@ auto ConsumeNode(FuzzedDataProvider& fuzzed_data_provider, const std::optional<N
|
|
| 261 |
addr_name,
|
| 262 |
conn_type,
|
| 263 |
inbound_onion,
|
|
|
|
| 264 |
CNodeOptions{ .permission_flags = permission_flags }};
|
| 265 |
}
|
| 266 |
}
|
|
|
|
| 239 |
const std::string addr_name = fuzzed_data_provider.ConsumeRandomLengthString(64);
|
| 240 |
const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray(ALL_CONNECTION_TYPES);
|
| 241 |
const bool inbound_onion{conn_type == ConnectionType::INBOUND ? fuzzed_data_provider.ConsumeBool() : false};
|
| 242 |
+
const uint64_t network_id = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
|
| 243 |
+
|
| 244 |
NetPermissionFlags permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
|
| 245 |
if constexpr (ReturnUniquePtr) {
|
| 246 |
return std::make_unique<CNode>(node_id,
|
|
|
|
| 252 |
addr_name,
|
| 253 |
conn_type,
|
| 254 |
inbound_onion,
|
| 255 |
+
network_id,
|
| 256 |
CNodeOptions{ .permission_flags = permission_flags });
|
| 257 |
} else {
|
| 258 |
return CNode{node_id,
|
|
|
|
| 264 |
addr_name,
|
| 265 |
conn_type,
|
| 266 |
inbound_onion,
|
| 267 |
+
network_id,
|
| 268 |
CNodeOptions{ .permission_flags = permission_flags }};
|
| 269 |
}
|
| 270 |
}
|