summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-03-11 10:24:28 +0100
committerFelix Fietkau <nbd@openwrt.org>2014-03-11 10:25:04 +0100
commit047a1ee7680e9a668896a12e2773d6544669d0e9 (patch)
tree2373798c7b6840325e1eb8c6dabcdb15572114f6
parentb114b86c70766f67f503077ad1de013c17fbf366 (diff)
Revert "ubus events: don't incorrectly announce an interface as being up"
Made obsolete by b114b86c70766f67f503077ad1de013c17fbf366 This reverts commit 4d1a597f65bbb49aa843112812d5ca929478c706.
-rw-r--r--ubus.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ubus.c b/ubus.c
index 6a87c28..b81136b 100644
--- a/ubus.c
+++ b/ubus.c
@@ -636,13 +636,13 @@ interface_ip_dump_dns_search_list(struct interface_ip_settings *ip,
}
static void
-netifd_dump_status(struct interface *iface, bool up)
+netifd_dump_status(struct interface *iface)
{
struct interface_data *data;
struct device *dev;
void *a, *inactive;
- blobmsg_add_u8(&b, "up", up && iface->state == IFS_UP);
+ blobmsg_add_u8(&b, "up", iface->state == IFS_UP);
blobmsg_add_u8(&b, "pending", iface->state == IFS_SETUP);
blobmsg_add_u8(&b, "available", iface->available);
blobmsg_add_u8(&b, "autostart", iface->autostart);
@@ -753,7 +753,7 @@ netifd_handle_status(struct ubus_context *ctx, struct ubus_object *obj,
struct interface *iface = container_of(obj, struct interface, ubus);
blob_buf_init(&b, 0);
- netifd_dump_status(iface, true);
+ netifd_dump_status(iface);
ubus_send_reply(ctx, req, b.head);
return 0;
@@ -772,7 +772,7 @@ netifd_handle_dump(struct ubus_context *ctx, struct ubus_object *obj,
vlist_for_each_element(&interfaces, iface, node) {
void *i = blobmsg_open_table(&b, NULL);
blobmsg_add_string(&b, "interface", iface->name);
- netifd_dump_status(iface, true);
+ netifd_dump_status(iface);
blobmsg_close_table(&b, i);
}
@@ -1163,7 +1163,7 @@ netifd_ubus_interface_notify(struct interface *iface, bool up)
const char *event = (up) ? "update" : "down";
blob_buf_init(&b, 0);
blobmsg_add_string(&b, "interface", iface->name);
- netifd_dump_status(iface, up);
+ netifd_dump_status(iface);
ubus_notify(ubus_ctx, &iface_object, event, b.head, -1);
ubus_notify(ubus_ctx, &iface->ubus, event, b.head, -1);
}