diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-11-17 15:15:08 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-11-17 15:15:08 +0100 |
commit | 0eb6aa7562ae8db51c09b2c370a65f01b0ac1cff (patch) | |
tree | 4b10135d9fad0bd344d549494a721dfb0a61713d | |
parent | 5a0328c7b039a90e988aaab8e03eb8ce5508d62b (diff) |
device: fetch settings from external devices to make them usable for status output
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | device.c | 2 | ||||
-rw-r--r-- | system-dummy.c | 4 | ||||
-rw-r--r-- | system-linux.c | 2 | ||||
-rw-r--r-- | system.h | 1 |
4 files changed, 8 insertions, 1 deletions
@@ -337,6 +337,8 @@ int device_claim(struct device_user *dep) device_set_ifindex(dev, system_if_resolve(dev)); if (!dev->ifindex) ret = -1; + + system_if_get_settings(dev, &dev->orig_settings); } else ret = dev->set_state(dev, true); diff --git a/system-dummy.c b/system-dummy.c index 76c6ffa..9c734ea 100644 --- a/system-dummy.c +++ b/system-dummy.c @@ -83,6 +83,10 @@ int system_if_down(struct device *dev) return 0; } +void system_if_get_settings(struct device *dev, struct device_settings *s) +{ +} + void system_if_clear_state(struct device *dev) { } diff --git a/system-linux.c b/system-linux.c index b190ec6..d3bb64d 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1053,7 +1053,7 @@ int system_vlandev_del(struct device *vlandev) return system_link_del(vlandev->ifname); } -static void +void system_if_get_settings(struct device *dev, struct device_settings *s) { struct ifreq ifr; @@ -114,6 +114,7 @@ int system_vlan_del(struct device *dev); int system_vlandev_add(struct device *vlandev, struct device *dev, struct vlandev_config *cfg); int system_vlandev_del(struct device *vlandev); +void system_if_get_settings(struct device *dev, struct device_settings *s); void system_if_clear_state(struct device *dev); int system_if_up(struct device *dev); int system_if_down(struct device *dev); |