From: Bert Goemans Date: Thu, 11 Jan 2024 16:17:42 +0000 (+0100) Subject: odhcp6c: set server address from Information-request reply X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=77e1ae21e67f81840024ffe5bb7cf69a8fb0d2f0;p=project%2Fodhcp6c.git 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 Link: https://github.com/openwrt/odhcp6c/pull/83 Signed-off-by: Álvaro Fernández Rojas --- 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;