[DEV_ATTR_LEARNING] = { .name ="learning", .type = BLOBMSG_TYPE_BOOL },
[DEV_ATTR_UNICAST_FLOOD] = { .name ="unicast_flood", .type = BLOBMSG_TYPE_BOOL },
[DEV_ATTR_SENDREDIRECTS] = { .name = "sendredirects", .type = BLOBMSG_TYPE_BOOL },
+ [DEV_ATTR_NEIGHLOCKTIME] = { .name = "neighlocktime", .type = BLOBMSG_TYPE_INT32 },
};
const struct uci_blob_param_list device_attr_list = {
s->neigh4gcstaletime : os->neigh4gcstaletime;
n->neigh6gcstaletime = s->flags & DEV_OPT_NEIGHGCSTALETIME ?
s->neigh6gcstaletime : os->neigh6gcstaletime;
+ n->neigh4locktime = s->flags & DEV_OPT_NEIGHLOCKTIME ?
+ s->neigh4locktime : os->neigh4locktime;
n->dadtransmits = s->flags & DEV_OPT_DADTRANSMITS ?
s->dadtransmits : os->dadtransmits;
n->multicast = s->flags & DEV_OPT_MULTICAST ?
s->flags |= DEV_OPT_NEIGHGCSTALETIME;
}
+ if ((cur = tb[DEV_ATTR_NEIGHLOCKTIME])) {
+ s->neigh4locktime = blobmsg_get_u32(cur);
+ s->flags |= DEV_OPT_NEIGHLOCKTIME;
+ }
+
if ((cur = tb[DEV_ATTR_RPS])) {
s->rps = blobmsg_get_bool(cur);
s->flags |= DEV_OPT_RPS;
blobmsg_add_u32(b, "neigh4gcstaletime", st.neigh4gcstaletime);
blobmsg_add_u32(b, "neigh6gcstaletime", st.neigh6gcstaletime);
}
+ if (st.flags & DEV_OPT_NEIGHLOCKTIME)
+ blobmsg_add_u32(b, "neigh4locktime", st.neigh4locktime);
if (st.flags & DEV_OPT_DADTRANSMITS)
blobmsg_add_u32(b, "dadtransmits", st.dadtransmits);
if (st.flags & DEV_OPT_MULTICAST_TO_UNICAST)
DEV_ATTR_UNICAST_FLOOD,
DEV_ATTR_NEIGHGCSTALETIME,
DEV_ATTR_SENDREDIRECTS,
+ DEV_ATTR_NEIGHLOCKTIME,
__DEV_ATTR_MAX,
};
DEV_OPT_NEIGHGCSTALETIME = (1 << 19),
DEV_OPT_MULTICAST_FAST_LEAVE = (1 << 20),
DEV_OPT_SENDREDIRECTS = (1 << 21),
+ DEV_OPT_NEIGHLOCKTIME = (1 << 22),
};
/* events broadcasted to all users of a device */
unsigned int neigh6reachabletime;
unsigned int neigh4gcstaletime;
unsigned int neigh6gcstaletime;
+ unsigned int neigh4locktime;
bool rps;
bool xps;
unsigned int dadtransmits;
system_set_dev_sysctl("/proc/sys/net/ipv6/neigh/%s/gc_stale_time", dev->ifname, val);
}
+static void system_set_neigh4locktime(struct device *dev, const char *val)
+{
+ system_set_dev_sysctl("/proc/sys/net/ipv4/neigh/%s/locktime", 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);
dev->ifname, buf, buf_sz);
}
+static int system_get_neigh4locktime(struct device *dev, char *buf, const size_t buf_sz)
+{
+ return system_get_dev_sysctl("/proc/sys/net/ipv4/neigh/%s/locktime",
+ 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",
s->flags |= DEV_OPT_NEIGHREACHABLETIME;
}
+ if (!system_get_neigh4locktime(dev, buf, sizeof(buf))) {
+ s->neigh4locktime = strtoul(buf, NULL, 0);
+ s->flags |= DEV_OPT_NEIGHLOCKTIME;
+ }
+
if (!system_get_neigh4gcstaletime(dev, buf, sizeof(buf))) {
s->neigh4gcstaletime = strtoul(buf, NULL, 0);
s->flags |= DEV_OPT_NEIGHGCSTALETIME;
snprintf(buf, sizeof(buf), "%d", s->neigh6reachabletime);
system_set_neigh6reachabletime(dev, buf);
}
+ if (s->flags & DEV_OPT_NEIGHLOCKTIME & apply_mask) {
+ snprintf(buf, sizeof(buf), "%d", s->neigh4locktime);
+ system_set_neigh4locktime(dev, buf);
+ }
if (s->flags & DEV_OPT_NEIGHGCSTALETIME & apply_mask) {
snprintf(buf, sizeof(buf), "%d", s->neigh4gcstaletime);
system_set_neigh4gcstaletime(dev, buf);