[DEV_ATTR_ENABLED] = { .name = "enabled", .type = BLOBMSG_TYPE_BOOL },
[DEV_ATTR_IPV6] = { .name = "ipv6", .type = BLOBMSG_TYPE_BOOL },
[DEV_ATTR_PROMISC] = { .name = "promisc", .type = BLOBMSG_TYPE_BOOL },
+ [DEV_ATTR_RPFILTER] = { .name = "rpfilter", .type = BLOBMSG_TYPE_STRING },
};
const struct uci_blob_param_list device_attr_list = {
sizeof(n->macaddr));
n->ipv6 = s->flags & DEV_OPT_IPV6 ? s->ipv6 : os->ipv6;
n->promisc = s->flags & DEV_OPT_PROMISC ? s->promisc : os->promisc;
+ n->rpfilter = s->flags & DEV_OPT_RPFILTER ? s->rpfilter : os->rpfilter;
n->flags = s->flags | os->flags;
}
s->flags |= DEV_OPT_PROMISC;
}
+ if ((cur = tb[DEV_ATTR_RPFILTER])) {
+ if (system_resolve_rpfilter(blobmsg_data(cur), &s->rpfilter))
+ s->flags |= DEV_OPT_RPFILTER;
+ else
+ DPRINTF("Failed to resolve rpfilter: %s\n", (char *) blobmsg_data(cur));
+ }
+
device_set_disabled(dev, disabled);
}
blobmsg_add_u8(b, "ipv6", st.ipv6);
if (st.flags & DEV_OPT_PROMISC)
blobmsg_add_u8(b, "promisc", st.promisc);
+ if (st.flags & DEV_OPT_RPFILTER)
+ blobmsg_add_u32(b, "rpfilter", st.rpfilter);
}
s = blobmsg_open_table(b, "statistics");