Clear the host bits of the device prefix in
interface_ip_add_device_prefix as interface_set_prefix_address just ORs
the calculated assignment part which would lead to an invalid IPv6
address if the host bits are not masked out
Suggested-by: Daniel Gröber <dxld@darkboxed.org>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
uint8_t length, time_t valid_until, time_t preferred_until,
struct in6_addr *excl_addr, uint8_t excl_length, const char *pclass)
{
uint8_t length, time_t valid_until, time_t preferred_until,
struct in6_addr *excl_addr, uint8_t excl_length, const char *pclass)
{
+ union if_addr a = { .in6 = *addr };
+
if (!pclass)
pclass = (iface) ? iface->name : "local";
if (!pclass)
pclass = (iface) ? iface->name : "local";
if (!prefix)
return NULL;
if (!prefix)
return NULL;
+ clear_if_addr(&a, length);
+
prefix->preferred_until = preferred_until;
prefix->valid_until = valid_until;
prefix->iface = iface;
prefix->preferred_until = preferred_until;
prefix->valid_until = valid_until;
prefix->iface = iface;