summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2015-06-25 12:38:52 +0200
committerSteven Barth <steven@midlink.org>2015-07-03 12:27:55 +0200
commit7dcacc6189ff255b87d9779facedfb15e140d0d3 (patch)
tree56eaec4698318c4ea8e4701a92fe1eeeeb917450 /device.c
parent5b29ffda0099c3bcb8d17a728e1e89dc21a2e68d (diff)
netifd: Add dadtransmits config option
Config option dadtransmits allows to configure the amount of Duplicate Address Detection probes to be sent Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'device.c')
-rw-r--r--device.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/device.c b/device.c
index 1265c86..fec5bce 100644
--- a/device.c
+++ b/device.c
@@ -47,6 +47,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = {
[DEV_ATTR_NEIGHREACHABLETIME] = { .name = "neighreachabletime", .type = BLOBMSG_TYPE_INT32 },
[DEV_ATTR_RPS] = { .name = "rps", .type = BLOBMSG_TYPE_BOOL },
[DEV_ATTR_XPS] = { .name = "xps", .type = BLOBMSG_TYPE_BOOL },
+ [DEV_ATTR_DADTRANSMITS] = { .name = "dadtransmits", .type = BLOBMSG_TYPE_INT32 },
};
const struct uci_blob_param_list device_attr_list = {
@@ -170,7 +171,9 @@ device_merge_settings(struct device *dev, struct device_settings *n)
n->neigh4reachabletime = s->flags & DEV_OPT_NEIGHREACHABLETIME ?
s->neigh4reachabletime : os->neigh4reachabletime;
n->neigh6reachabletime = s->flags & DEV_OPT_NEIGHREACHABLETIME ?
- s->neigh6reachabletime : os->neigh6reachabletime;
+ s->neigh6reachabletime : os->neigh6reachabletime;
+ n->dadtransmits = s->flags & DEV_OPT_DADTRANSMITS ?
+ s->dadtransmits : os->dadtransmits;
n->flags = s->flags | os->flags;
}
@@ -266,6 +269,11 @@ device_init_settings(struct device *dev, struct blob_attr **tb)
else
s->xps = default_ps;
+ if ((cur = tb[DEV_ATTR_DADTRANSMITS])) {
+ s->dadtransmits = blobmsg_get_u32(cur);
+ s->flags |= DEV_OPT_DADTRANSMITS;
+ }
+
device_set_disabled(dev, disabled);
}
@@ -872,6 +880,8 @@ device_dump_status(struct blob_buf *b, struct device *dev)
blobmsg_add_u32(b, "neigh4reachabletime", st.neigh4reachabletime);
blobmsg_add_u32(b, "neigh6reachabletime", st.neigh6reachabletime);
}
+ if (st.flags & DEV_OPT_DADTRANSMITS)
+ blobmsg_add_u32(b, "dadtransmits", st.dadtransmits);
}
s = blobmsg_open_table(b, "statistics");