diff --git a/netstack/src/scheme/netcfg/mod.rs b/netstack/src/scheme/netcfg/mod.rs index 2e4f1cfc04..b381d1be1c 100644 --- a/netstack/src/scheme/netcfg/mod.rs +++ b/netstack/src/scheme/netcfg/mod.rs @@ -128,7 +128,7 @@ fn mk_root_node( nat — NAT bindings (bindings / stats)\n\ capture — packet capture (enable/read/filter/count)\n\ sysctl — kernel tunables (net/ipv4/ip_forward)\n\ - route — routing table (list/add/rm/count/gateway)\n\ + route — routing table (list/add/rm/flush/count/gateway)\n\ resolv — DNS configuration (nameserver/nameserver6)\n\ ifaces — per-interface config/stats (eth0/lo/...)\n\ version — netstack version info\n" @@ -566,9 +566,20 @@ fn mk_root_node( notifier.borrow_mut().schedule_notify("route/list"); } Ok(()) - } - }, - }, + } + }, + "flush" => { + wo [route_table, notifier] (Option<()>, None) + |_cur_value, _line| { + Ok(()) + } + |_cur_value| { + *route_table.borrow_mut() = RouteTable::default(); + notifier.borrow_mut().schedule_notify("route/list"); + Ok(()) + } + }, + }, "arp" => { "list" => { ro [devices] || {