#16754: Script ifup does not take new network config
---------------------------------+---------------------------------------
Reporter: chenweiyang@… | Owner: developers
Type: defect | Status: new
Priority: normal | Milestone: Attitude Adjustment 12.09
Component: packages | Version: Trunk
Keywords: ifup netifd network |
---------------------------------+---------------------------------------
The ifup script from netifd package reloads network config then bring
down/up the interface. But since netifd handles ubus reload call with an
async event loop, new config haven't been taken account when the interface
is brought up.
{{{#!c
void netifd_reload(void)
{
main_timer.cb = netifd_do_reload;
uloop_timeout_set(&main_timer, 100);
}
}}}
A resonable fix is put ifup to sleep one second after issues network
reload, letting netifd_do_reload does its work, then restart interface.
{{{#!bash
diff --git a/package/netifd/files/sbin/ifup
b/package/netifd/files/sbin/ifup
index af3aaa8..15c0c8e 100755
--- a/package/netifd/files/sbin/ifup
+++ b/package/netifd/files/sbin/ifup
@@ -35,7 +35,7 @@ while :; do
-[ "$modes" = "down up" ] && ubus call network reload
+[ "$modes" = "down up" ] && ubus call network reload && sleep 1
if [ -n "$ifup_all" ]; then
for interface in `ubus -S list 'network.interface.*'`; do
if_call "${interface##network.interface.}"
}}}
--
Ticket URL: <https://dev.openwrt.org/ticket/16754>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets