diff options
| author | Hans Dedecker | 2016-03-31 10:18:27 +0000 |
|---|---|---|
| committer | Jo-Philipp Wich | 2016-03-31 10:29:08 +0000 |
| commit | 6fd6be6b7f3fc4883fdc464fcbcb2b5e8d8e8174 (patch) | |
| tree | d89cb285244973f53a6329ae915ae077b1e331a8 | |
| parent | 39d9ceeb96162a83a3f5fa63e6aaa1ccb38caa62 (diff) | |
| download | netifd-6fd6be6b7f3fc4883fdc464fcbcb2b5e8d8e8174.tar.gz | |
alias : Fix interface aliased on top of a static interface not getting active
An interfaces referring to a static interface is not getting active when doing a network
reload or ifup.
The problem is triggered by alias_set_device which is not clearing the pending update
(mostly a null device due to the previous down event) when the same device is set as the
current device via alias_notify_device.
As a result alias_set_device_state when called will overwrite the device with an invalid
pending device meaning the interface will not be set available anymore and thus will
stay down.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
| -rw-r--r-- | alias.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -34,8 +34,15 @@ static const struct device_type alias_device_type; static void alias_set_device(struct alias_device *alias, struct device *dev) { - if (dev == alias->dep.dev) + if (dev == alias->dep.dev) { + if (alias->update) { + device_remove_user(&alias->new_dep); + alias->update = false; + if (dev) + device_set_present(&alias->dev, true); + } return; + } device_set_present(&alias->dev, false); device_remove_user(&alias->new_dep); |