Signed-off-by: Maico Le Pape <mlepape@cisco.com>
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);
}
} else {
buf_len += snprintf(&buf[buf_len], 24, ",%u,%u", e[i].preferred, e[i].valid);
}
- if (type == ENTRY_PREFIX && e[i].prefix_class) {
+ if ((type == ENTRY_PREFIX || type == ENTRY_ADDRESS) && e[i].prefix_class) {
buf_len += snprintf(&buf[buf_len], 12, ",class=%u", e[i].prefix_class);
}