if (!bm->active) {
ret = system_bridge_addif(&bst->dev, bm->dev.dev);
if (ret < 0) {
- D(DEVICE, "Bridge device %s could not be added\n", bm->dev.dev->ifname);
+ D(DEVICE, "Bridge device %s could not be added", bm->dev.dev->ifname);
goto error;
}
bridge_disable_member(bm, true);
break;
case DEV_EVENT_REMOVE:
- if (dep->hotplug) {
+ if (dep->hotplug && !dev->sys_present) {
vlist_delete(&bst->members, &bm->node);
return;
}
struct blob_attr *tb_br[__BRIDGE_ATTR_MAX];
enum dev_change_type ret = DEV_CONFIG_APPLIED;
struct bridge_state *bst;
- unsigned long diff[2];
+ unsigned long diff[2] = {};
BUILD_BUG_ON(sizeof(diff) < __BRIDGE_ATTR_MAX / BITS_PER_LONG);
BUILD_BUG_ON(sizeof(diff) < __DEV_ATTR_MAX / BITS_PER_LONG);
blobmsg_parse(device_attr_list.params, __DEV_ATTR_MAX, otb_dev,
blob_data(bst->config_data), blob_len(bst->config_data));
- diff[0] = diff[1] = 0;
uci_blob_diff(tb_dev, otb_dev, &device_attr_list, diff);
if (diff[0] | diff[1]) {
ret = DEV_CONFIG_RESTART;
- D(DEVICE, "Bridge %s device attributes have changed, diff=[%lx %lx]\n",
+ D(DEVICE, "Bridge %s device attributes have changed, diff=[%lx %lx]",
dev->ifname, diff[1], diff[0]);
}
uci_blob_diff(tb_br, otb_br, &bridge_attr_list, diff);
if (diff[0] & ~(1 << BRIDGE_ATTR_PORTS)) {
ret = DEV_CONFIG_RESTART;
- D(DEVICE, "Bridge %s attributes have changed, diff=[%lx %lx]\n",
+ D(DEVICE, "Bridge %s attributes have changed, diff=[%lx %lx]",
dev->ifname, diff[1], diff[0]);
}
if (node_new)
vlan_new->pending = true;
- bst->dev.config_pending = true;
-
out:
+ bst->dev.config_pending = true;
bridge_vlan_free(vlan_old);
}