Commit 307298d
committed
mctpd: allow bridge allocation with SetupEndpoint
Currently, we only allow bridge pool allocation through an
AssignEndpoint call, as that is guaranteed to involve a Set Endpoint ID
command, required to start the pool allocation process.
LearnEndpoint is intended to never modify endpoint state, so we keep that
as-is.
SetupEndpoint has always been a convenience method, intended to do a
LearnEndpoint if possible, or fall back to AssignEndpoint if not.
Because of this, we are not making any assurances about preserving state
with SetupEndpoint.
With the new bridge support, the current distinction between
AssignEndpoint (which will allocate a bridge pool) and SetupEndpoint
(which will not) is a potential point of confusion. Instead, allow
bridge allocations through SetupEndpoint.
We have a new conditional path here: we try the LearnEndpoint (ie, a Get
Endpoint ID, to see if we can use that EID) first, but add a new check
to determine if this is a bridge EID type. Is so, we force the fallback
to Set Endpoint ID, which will allow a bridge EID allocation too.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>1 parent c022a72 commit 307298d
File tree
4 files changed
+85
-10
lines changed- src
- tests
- mctpenv
4 files changed
+85
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
282 | 304 | | |
283 | 305 | | |
284 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2383 | 2383 | | |
2384 | 2384 | | |
2385 | 2385 | | |
2386 | | - | |
| 2386 | + | |
| 2387 | + | |
2387 | 2388 | | |
2388 | | - | |
2389 | | - | |
2390 | | - | |
2391 | | - | |
2392 | | - | |
2393 | | - | |
2394 | | - | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
2395 | 2407 | | |
2396 | 2408 | | |
2397 | 2409 | | |
| |||
2400 | 2412 | | |
2401 | 2413 | | |
2402 | 2414 | | |
2403 | | - | |
| 2415 | + | |
2404 | 2416 | | |
2405 | 2417 | | |
2406 | 2418 | | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
2407 | 2422 | | |
2408 | 2423 | | |
2409 | 2424 | | |
| |||
2582 | 2597 | | |
2583 | 2598 | | |
2584 | 2599 | | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
2585 | 2608 | | |
2586 | 2609 | | |
2587 | 2610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
365 | 368 | | |
366 | 369 | | |
367 | 370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
1045 | 1072 | | |
1046 | 1073 | | |
1047 | 1074 | | |
| |||
0 commit comments