Modify

Opened 4 years ago

Closed 4 years ago

Last modified 13 months ago

#16754 closed defect (fixed)

Script ifup does not take new network config

Reported by: chenweiyang@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: ifup netifd network Cc:

Description

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.

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.

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.}"

Attachments (1)

0001-Fix-network-reload-does-not-work-in-ifup-script.patch (765 bytes) - added by anonymous 4 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 4 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

fixed in r41112

comment:2 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

comment:3 Changed 13 months ago by tillw

It looks like chenweiyang's patch was never applied. The mentioned changeset r41112 does only contain changes to trunk/package/network/config/netifd/Makefile but not to ifup. Also, I couldn't find the "sleep 1" in the ifup file of OpenWRT 15.05.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.