Changes for more readability.
authorYousong Zhou <yszhou4tech@gmail.com>
Fri, 21 Aug 2015 02:11:56 +0000 (10:11 +0800)
committerSteven Barth <steven@midlink.org>
Tue, 25 Aug 2015 06:26:56 +0000 (08:26 +0200)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
device.h
interface.c
interface.h
ubus.c

index ce135bac7edeee5f0846a6d36ffa6dd4b21b9090..798e19e834a446c09d57a25e742c2729b4a08f9d 100644 (file)
--- a/device.h
+++ b/device.h
@@ -160,8 +160,11 @@ struct device {
        struct blob_attr *config;
        bool config_pending;
        bool sys_present;
+       /* DEV_EVENT_ADD */
        bool present;
+       /* DEV_EVENT_UP */
        int active;
+       /* DEV_EVENT_LINK_UP */
        bool link_active;
 
        bool external;
index 848990eae5b5a305d120192fe5fe9b377116e11e..ffe79880779081327c2a5741310218c696c0efa6 100644 (file)
@@ -649,7 +649,7 @@ interface_handle_config_change(struct interface *iface)
 }
 
 static void
-interface_proto_cb(struct interface_proto_state *state, enum interface_proto_event ev)
+interface_proto_event_cb(struct interface_proto_state *state, enum interface_proto_event ev)
 {
        struct interface *iface = state->iface;
 
@@ -708,7 +708,7 @@ void interface_set_proto_state(struct interface *iface, struct interface_proto_s
        if (!state)
                return;
 
-       state->proto_event = interface_proto_cb;
+       state->proto_event = interface_proto_event_cb;
        state->iface = iface;
 }
 
index 8eeb7db8a1c34c3afeb97c9dbf283ef885acf728..6f9112c5965dbaa48ba206b9e480a77ca4c1dba8 100644 (file)
@@ -120,6 +120,7 @@ struct interface {
 
        struct list_head users;
 
+       /* for alias interface */
        const char *parent_ifname;
        struct interface_user parent_iface;
 
diff --git a/ubus.c b/ubus.c
index 56f7bddd06c56048b539b2b7ddfe68ccbca4bc2d..c834d11bba38db4e4ba610db56d6b882f38a4efd 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -817,7 +817,7 @@ netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
 
        cur = tb[DEV_LINK_EXT];
        if (cur)
-               link_ext = !!blobmsg_get_u8(cur);
+               link_ext = blobmsg_get_bool(cur);
 
        return interface_handle_link(iface, blobmsg_data(tb[DEV_LINK_NAME]), add, link_ext);
 }