diff options
| author | Bert Goemans | 2024-01-11 16:17:42 +0000 |
|---|---|---|
| committer | Álvaro Fernández Rojas | 2025-10-21 16:58:17 +0000 |
| commit | 77e1ae21e67f81840024ffe5bb7cf69a8fb0d2f0 (patch) | |
| tree | b059aaa2f25995399d6ae9627ecfc69b82ab6d59 | |
| parent | e24ac1cf8c27116705f6abedd89be4d7533fc511 (diff) | |
| download | odhcp6c-77e1ae21e67f81840024ffe5bb7cf69a8fb0d2f0.tar.gz | |
odhcp6c: set server address from Information-request reply
Update the environment variable STATE_SERVER_ADDR with the address
of the DHCPv6 server when a reply to an Information-request message
is received. Without this, there is no way of knowing which server
replied to the Information-request.
This is also consistent with the way that replies to Request and
Rebind messages are handled.
Signed-off-by: Bert Goemans <bert.goemans_ext@softathome.com>
Link: https://github.com/openwrt/odhcp6c/pull/83
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
| -rw-r--r-- | src/dhcpv6.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 2075006..4c1b889 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -1353,6 +1353,9 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, _unused const int rc, if (!odhcp6c_is_bound()) dhcpv6_clear_all_server_cand(); + odhcp6c_clear_state(STATE_SERVER_ADDR); + odhcp6c_add_state(STATE_SERVER_ADDR, &from->sin6_addr, 16); + t1 = refresh; break; |