[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 = {
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;
}
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);
}
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");
system_set_dev_sysctl("/proc/sys/net/ipv6/neigh/%s/base_reachable_time_ms", dev->ifname, val);
}
+static void system_set_dadtransmits(struct device *dev, const char *val)
+{
+ system_set_dev_sysctl("/proc/sys/net/ipv6/conf/%s/dad_transmits", dev->ifname, val);
+}
+
static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz)
{
int fd = -1, ret = -1;
dev->ifname, buf, buf_sz);
}
+static int system_get_dadtransmits(struct device *dev, char *buf, const size_t buf_sz)
+{
+ return system_get_dev_sysctl("/proc/sys/net/ipv6/conf/%s/dad_transmits",
+ dev->ifname, buf, buf_sz);
+}
+
// Evaluate netlink messages
static int cb_rtnl_event(struct nl_msg *msg, void *arg)
{
s->neigh6reachabletime = strtoul(buf, NULL, 0);
s->flags |= DEV_OPT_NEIGHREACHABLETIME;
}
+
+ if (!system_get_dadtransmits(dev, buf, sizeof(buf))) {
+ s->dadtransmits = strtoul(buf, NULL, 0);
+ s->flags |= DEV_OPT_DADTRANSMITS;
+ }
}
static void
system_if_apply_settings(struct device *dev, struct device_settings *s, unsigned int apply_mask)
{
struct ifreq ifr;
+ char buf[12];
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, dev->ifname, sizeof(ifr.ifr_name));
s->flags &= ~DEV_OPT_PROMISC;
}
if (s->flags & DEV_OPT_RPFILTER & apply_mask) {
- char buf[2];
-
snprintf(buf, sizeof(buf), "%d", s->rpfilter);
system_set_rpfilter(dev, buf);
}
if (s->flags & DEV_OPT_ACCEPTLOCAL & apply_mask)
system_set_acceptlocal(dev, s->acceptlocal ? "1" : "0");
if (s->flags & DEV_OPT_IGMPVERSION & apply_mask) {
- char buf[2];
-
snprintf(buf, sizeof(buf), "%d", s->igmpversion);
system_set_igmpversion(dev, buf);
}
if (s->flags & DEV_OPT_MLDVERSION & apply_mask) {
- char buf[2];
-
snprintf(buf, sizeof(buf), "%d", s->mldversion);
system_set_mldversion(dev, buf);
}
if (s->flags & DEV_OPT_NEIGHREACHABLETIME & apply_mask) {
- char buf[12];
-
snprintf(buf, sizeof(buf), "%d", s->neigh4reachabletime);
system_set_neigh4reachabletime(dev, buf);
snprintf(buf, sizeof(buf), "%d", s->neigh6reachabletime);
system_set_neigh6reachabletime(dev, buf);
}
+ if (s->flags & DEV_OPT_DADTRANSMITS & apply_mask) {
+ snprintf(buf, sizeof(buf), "%d", s->dadtransmits);
+ system_set_dadtransmits(dev, buf);
+ }
system_if_apply_rps_xps(dev, s);
}