Commit cf51aeb
odhcpd: fix captive_portal_uri reset
odhcpd_reload() calls clean_interface() which does a memset() on the
given struct iface from iface->ra onwards, so captive_portal_uri and
captive_portal_uri_len have to be below iface->ra in order to be zeroed
on reload.
Otherwise, iface->captive_portal_uri will be free():d, but
iface->captive_portal_uri_len could still be > 0.
This is a bit of a footgun (one wouldn't normally expect the order of
struct members to matter), and should probably be dealt with in a more
thorough manner, but I've just done the minimum and added a warning in
src/odhcpd.h for now,
Signed-off-by: David Härdeman <david@hardeman.nu>
Link: openwrt#345
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>1 parent e8b7fde commit cf51aeb
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 394 | + | |
397 | 395 | | |
398 | 396 | | |
399 | 397 | | |
| |||
494 | 492 | | |
495 | 493 | | |
496 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
497 | 499 | | |
498 | 500 | | |
499 | 501 | | |
| |||
0 commit comments