Commit 9614b1a
committed
mctpd: fix endpoint peer iteration on interface delete
We currently scan through ctx->peers while deleting an interface,
removing pertinent peers.
However, the removal will shift the indices (and possibly realloc
ctx->peers). So, adjust our handling of the loop counter to suit.
Fixes: #97
Reported-by: Faizan Ali <faizana@nvidia.com>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>1 parent d7e57ed commit 9614b1a
3 files changed
+59
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3388 | 3388 | | |
3389 | 3389 | | |
3390 | 3390 | | |
3391 | | - | |
| 3391 | + | |
3392 | 3392 | | |
| 3393 | + | |
3393 | 3394 | | |
3394 | | - | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
3395 | 3399 | | |
3396 | 3400 | | |
3397 | | - | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
3398 | 3411 | | |
3399 | 3412 | | |
3400 | 3413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
751 | 789 | | |
752 | 790 | | |
753 | 791 | | |
| |||
0 commit comments