X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=blobdiff_plain;f=src%2Fdhcpv6.c;h=01d14942f73567337dabe9fdb0da8e07c7ce87c3;hp=7f2aa1a70ab91c22c2b18d0700c9e0c07ee2a639;hb=5217b2bb6c26f70f6fe570a340045a372020d06b;hpb=eb0b01e94374774609c31ab4508d8cfca8a400e1 diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 7f2aa1a..01d1494 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -885,6 +885,15 @@ static uint32_t dhcpv6_parse_ia(void *opt, void *end) entry.length = 128; entry.target = addr->addr; + uint16_t stype, slen; + uint8_t *sdata; + + // Find prefix class, if any + dhcpv6_for_each_option(&addr[1], odata + olen, + stype, slen, sdata) + if (stype == DHCPV6_OPT_PREFIX_CLASS && slen == 2) + entry.prefix_class = ntohs(*((uint16_t*)sdata)); + odhcp6c_update_entry(STATE_IA_NA, &entry); }