Commit 1ec9e9c
committed
[nrf fromtree] net: tcp: Fix ACK processing when FIN packet is received
In case FIN packed also acknowledged most recently sent data, not all
ack-related TCP context variables were updated, resulting in invalid SEQ
number values sent in consecutive packets.
Fix this by refactoring the FIN handling in TCP_ESTABLISHED state.
Instead of having a separate block strictly for FIN packet processing,
let the packet be processed by common code responsible for regular
data/ack processing. This should be less error-prone for any future
modifications or not-yet-discovered issues. Only after the common
processing of data/ack is done, we check whether FIN flag was present in
the packet, and mark the connection for closing.
Signed-off-by: Robert Lubos <[email protected]>
(cherry picked from commit 1781505)1 parent b33e0dc commit 1ec9e9c
1 file changed
+38
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2719 | 2719 | | |
2720 | 2720 | | |
2721 | 2721 | | |
2722 | | - | |
| 2722 | + | |
2723 | 2723 | | |
2724 | 2724 | | |
2725 | 2725 | | |
| |||
2732 | 2732 | | |
2733 | 2733 | | |
2734 | 2734 | | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
2735 | 2742 | | |
2736 | 2743 | | |
2737 | 2744 | | |
| |||
3143 | 3150 | | |
3144 | 3151 | | |
3145 | 3152 | | |
3146 | | - | |
3147 | | - | |
3148 | | - | |
3149 | | - | |
3150 | | - | |
3151 | | - | |
3152 | | - | |
3153 | | - | |
3154 | | - | |
3155 | | - | |
3156 | | - | |
3157 | | - | |
3158 | | - | |
3159 | | - | |
3160 | | - | |
3161 | | - | |
3162 | | - | |
3163 | | - | |
3164 | | - | |
3165 | | - | |
3166 | | - | |
3167 | | - | |
3168 | | - | |
3169 | | - | |
3170 | | - | |
3171 | | - | |
3172 | | - | |
3173 | | - | |
3174 | | - | |
3175 | | - | |
3176 | | - | |
| 3153 | + | |
| 3154 | + | |
3177 | 3155 | | |
3178 | 3156 | | |
3179 | 3157 | | |
| |||
3279 | 3257 | | |
3280 | 3258 | | |
3281 | 3259 | | |
3282 | | - | |
3283 | | - | |
3284 | | - | |
3285 | | - | |
3286 | | - | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
3287 | 3275 | | |
3288 | 3276 | | |
3289 | 3277 | | |
| |||
3314 | 3302 | | |
3315 | 3303 | | |
3316 | 3304 | | |
3317 | | - | |
| 3305 | + | |
3318 | 3306 | | |
3319 | 3307 | | |
3320 | 3308 | | |
| |||
3358 | 3346 | | |
3359 | 3347 | | |
3360 | 3348 | | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
3361 | 3360 | | |
| 3361 | + | |
3362 | 3362 | | |
3363 | 3363 | | |
3364 | 3364 | | |
| |||
0 commit comments