interface_do_reload(struct interface *iface)
{
interface_cleanup(iface);
-
- interface_claim_device(iface);
proto_init_interface(iface, iface->config);
+ interface_claim_device(iface);
}
static void
if_old->ifname = if_new->ifname;
if_old->proto_handler = if_new->proto_handler;
- if (strcmp(old_ifname, if_new->ifname) != 0 ||
- proto != if_new->proto_handler) {
+ if ((!!old_ifname != !!if_new->ifname) ||
+ (old_ifname && strcmp(old_ifname, if_new->ifname) != 0) ||
+ proto != if_new->proto_handler) {
D(INTERFACE, "Reload interface '%s' because of ifname/proto change\n",
if_old->name);
goto reload;