[PATCH netifd] bridge: make it more clear why the config was applied
Petr Štetiar
ynezz at true.cz
Thu Mar 9 02:56:42 PST 2023
In some cases we see, that the bridge configuration was applied, but its
not exactly clear why it was done, so lets add a simple debugging output
which should provide currently missing clue.
Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
bridge.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/bridge.c b/bridge.c
index 7e61b9df8326..9ed7c985afef 100644
--- a/bridge.c
+++ b/bridge.c
@@ -1152,16 +1152,22 @@ bridge_reload(struct device *dev, struct blob_attr *attr)
diff = 0;
uci_blob_diff(tb_dev, otb_dev, &device_attr_list, &diff);
- if (diff)
- ret = DEV_CONFIG_RESTART;
+ if (diff) {
+ ret = DEV_CONFIG_RESTART;
+ D(DEVICE, "Bridge %s device attributes has changed, diff=0x%lx\n",
+ dev->ifname, diff);
+ }
blobmsg_parse(bridge_attrs, __BRIDGE_ATTR_MAX, otb_br,
blob_data(bst->config_data), blob_len(bst->config_data));
diff = 0;
uci_blob_diff(tb_br, otb_br, &bridge_attr_list, &diff);
- if (diff & ~(1 << BRIDGE_ATTR_PORTS))
- ret = DEV_CONFIG_RESTART;
+ if (diff & ~(1 << BRIDGE_ATTR_PORTS)) {
+ ret = DEV_CONFIG_RESTART;
+ D(DEVICE, "Bridge %s attributes has changed, diff=0x%lx\n",
+ dev->ifname, diff);
+ }
bridge_config_init(dev);
}
More information about the openwrt-devel
mailing list