Commit 3eaf408
net/mptcp: Change some dubious min_t(int, ...) to min()
There are two:
min_t(int, xxx, mptcp_wnd_end(msk) - msk->snd_nxt);
Both mptcp_wnd_end(msk) and msk->snd_nxt are u64, their difference
(aka the window size) might be limited to 32 bits - but that isn't
knowable from this code.
So checks being added to min_t() detect the potential discard of
significant bits.
Provided the 'avail_size' and return of mptcp_check_allowed_size()
are changed to an unsigned type (size_t matches the type the caller
uses) both min_t() can be changed to min().
Signed-off-by: David Laight <[email protected]>1 parent 1ce101e commit 3eaf408
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
1128 | | - | |
1129 | | - | |
| 1128 | + | |
| 1129 | + | |
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
| |||
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
1138 | | - | |
| 1138 | + | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
| |||
1479 | 1479 | | |
1480 | 1480 | | |
1481 | 1481 | | |
1482 | | - | |
| 1482 | + | |
1483 | 1483 | | |
1484 | 1484 | | |
1485 | 1485 | | |
| |||
0 commit comments