Commit a2648b7
committed
Revert "router: optimize duplicated PIO comparison"
This reverts commit d354ebb.
As stated by David Härdeman at [1]:
Note that time_t will have an alignment of 4 (unlikely) or 8, meaning
that struct ra_pio will have padding. A straight memcmp() could
therefore generate the wrong result unless both struct ra_pios that are
compared are guaranteed to have been memset to zero.
Avoid the risk of something going wrong here by doing a straight
comparison of the two members of the struct that we want to compare.
[1]: openwrt@d02fce0
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>1 parent 6b88c31 commit a2648b7
2 files changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
| 349 | + | |
| 350 | + | |
353 | 351 | | |
354 | 352 | | |
355 | | - | |
356 | 353 | | |
357 | 354 | | |
358 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | | - | |
| 542 | + | |
| 543 | + | |
543 | 544 | | |
544 | 545 | | |
545 | 546 | | |
| |||
0 commit comments