bridge: make it more clear why the config was applied
authorPetr Štetiar <ynezz@true.cz>
Thu, 9 Mar 2023 08:30:19 +0000 (09:30 +0100)
committerPetr Štetiar <ynezz@true.cz>
Wed, 31 May 2023 16:43:05 +0000 (18:43 +0200)
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@true.cz>
bridge.c

index 6306bec9ca73e73ab7dc628f26d7e0efbc7fbfd6..8a5b7588a49b11b3979b01234a9604fa3811adb6 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -1153,16 +1153,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 have 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 have changed, diff=0x%lx\n",
+                         dev->ifname, diff);
+               }
 
                bridge_config_init(dev);
        }