diff options
author | Steven Barth <steven@midlink.org> | 2013-10-18 12:09:42 +0200 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2013-10-18 12:09:42 +0200 |
commit | e93c42c036c4b4df1f65f261def31cf1a429e942 (patch) | |
tree | 2d92d5d871b10c542402d9d99b354daaf839b545 /ubus.c | |
parent | ddbd2cc51b3db14f6a8bd46ceebaee9097a50b78 (diff) |
Add source-restricted routes
Diffstat (limited to 'ubus.c')
-rw-r--r-- | ubus.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -488,6 +488,11 @@ interface_ip_dump_route_list(struct interface_ip_settings *ip, bool enabled) if (route->valid_until) blobmsg_add_u32(&b, "valid", route->valid_until - now); + buf = blobmsg_alloc_string_buffer(&b, "source", buflen); + inet_ntop(af, &route->source, buf, buflen); + snprintf(buf + strlen(buf), 4, "/%u", route->sourcemask); + blobmsg_add_string_buffer(&b); + blobmsg_close_table(&b, r); } } @@ -727,6 +732,7 @@ netifd_handle_status(struct ubus_context *ctx, struct ubus_object *obj, return 0; } + static int netifd_handle_dump(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, |