Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
}
if (!iface->ifname[0] && !ifname)
- return -1;
+ goto err;
if (ifname)
strncpy(iface->ifname, ifname, sizeof(iface->ifname) - 1);
if ((iface->ifindex = if_nametoindex(iface->ifname)) <= 0)
- return -1;
+ goto err;
iface->inuse = true;
uloop_timeout_cancel(&iface->timer_rs);
iface->timer_rs.cb = NULL;
+ if (iface->ifindex <= 0)
+ return -1;
+
setsockopt(router_event.uloop.fd, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP,
&all_nodes, sizeof(all_nodes));
setsockopt(router_event.uloop.fd, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP,