When sending challenge ACKs from the SYN-cache, apply the same rate limiting as in other states.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| sys/netinet/tcp_syncache.c | ||
|---|---|---|
| 1658 | I think the two new members of struct syncache shall be initialized around here. | |
| 2070–2072 | Can remove the else clause by initialize the error first. Like this: static int if (...) { ... } return (error); Just my two cents if it is just a coding style. | |
| sys/netinet/tcp_syncache.c | ||
|---|---|---|
| 1658 |
sc is initialized to zero either using uma_zalloc(..., ...| M_ZERO) or by bzero(). So we don't need to explicitly zero fields. Both new fields are therefore initialized to 0 as intended. | |
| 2070–2072 |
I actually prefer the style I used. I someone adds another branch, the person has to write an explicit initialization of error. If this is forgotten, it is detected by the compiler or a static code analyzer. If you unconditionally initialize it to 0, this bug is not catched (assuming you want a non-zero error value). | |