Pointer comparison is buggy as they are never null.
For an ipv6 address configuration, we always zeroed the structure,
hence the bcast and acast structure are equal to in6addr_any.
Any change of this value means the user specified something different
in the configuration file, so we fail gracefully.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
/* TODO : multicast, anycast with ipv6 */
err = EPROTONOSUPPORT;
- if ((bcast || acast) && family == AF_INET6)
+ if (family == AF_INET6 &&
+ (memcmp(bcast, &in6addr_any, sizeof(in6addr_any)) ||
+ memcmp(acast, &in6addr_any, sizeof(in6addr_any))))
goto out;
err = netlink_transaction(&nlh, nlmsg, answer);