udhcpc6: fix ipv6prefix[_lease] envvar value in script invocation
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 16 Jan 2018 15:00:13 +0000 (16:00 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 16 Jan 2018 15:00:13 +0000 (16:00 +0100)
Based on a patch by DannyAAM <danny@saru.moe>.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/udhcp/d6_dhcpc.c

index 37ffd064d67fb382a3096fcc9840ba02c4fe5298..65ff5deab01c8971e4d9a193a4f1b72ba1e6e11e 100644 (file)
@@ -277,11 +277,11 @@ static void option_to_env(uint8_t *option, uint8_t *option_end)
  * |               |
  * +-+-+-+-+-+-+-+-+
  */
-                       //move_from_unaligned32(v32, option + 4 + 4);
-                       //*new_env() = xasprintf("lease=%u", (unsigned)v32);
+                       move_from_unaligned32(v32, option + 4 + 4);
+                       *new_env() = xasprintf("ipv6prefix_lease=%u", (unsigned)v32);
 
-                       sprint_nip6(ipv6str, option + 4 + 4 + 1);
-                       *new_env() = xasprintf("ipv6prefix=%s/%u", ipv6str, (unsigned)(option[4 + 4]));
+                       sprint_nip6(ipv6str, option + 4 + 4 + 4 + 1);
+                       *new_env() = xasprintf("ipv6prefix=%s/%u", ipv6str, (unsigned)(option[4 + 4 + 4]));
                        break;
 #if ENABLE_FEATURE_UDHCPC6_RFC3646
                case D6_OPT_DNS_SERVERS: {