add better debug messages for interface create/remove/update
authorFelix Fietkau <nbd@openwrt.org>
Wed, 5 Oct 2011 14:03:16 +0000 (16:03 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 5 Oct 2011 14:03:16 +0000 (16:03 +0200)
config.c
interface.c

index cb79b2ab33bc48e32293ad7e726d928154c8f5d5..1ca02564a9ac9fe8b45e49c5e22209643f45b375 100644 (file)
--- a/config.c
+++ b/config.c
@@ -148,8 +148,6 @@ config_parse_interface(struct uci_section *s)
        const char *type;
        struct blob_attr *config;
 
-       D(INTERFACE, "Create interface '%s'\n", s->e.name);
-
        blob_buf_init(&b, 0);
 
        type = uci_lookup_option_string(uci_ctx, s, "type");
index 59b7ea23cae88dd85409109a0234ee8ae36b0421..73da2ab5053e73cc36d97512e369e97cf7dfeebb 100644 (file)
@@ -420,11 +420,14 @@ interface_update(struct vlist_tree *tree, struct vlist_node *node_new,
        struct interface *if_old = container_of(node_old, struct interface, node);
        struct interface *if_new = container_of(node_new, struct interface, node);
 
-       if (node_old && node_new)
+       if (node_old && node_new) {
+               D(INTERFACE, "Update interface '%s'\n", if_new->name);
                interface_change_config(if_old, if_new);
-       else if (node_old)
+       } else if (node_old) {
+               D(INTERFACE, "Remove interface '%s'\n", if_old->name);
                set_config_state(if_old, IFC_REMOVE);
-       else if (node_new) {
+       } else if (node_new) {
+               D(INTERFACE, "Create interface '%s'\n", if_new->name);
                interface_claim_device(if_new);
                proto_init_interface(if_new, if_new->config);
                interface_ip_init(if_new);