summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-11-17 15:15:08 +0100
committerFelix Fietkau <nbd@openwrt.org>2015-11-17 15:15:08 +0100
commit0eb6aa7562ae8db51c09b2c370a65f01b0ac1cff (patch)
tree4b10135d9fad0bd344d549494a721dfb0a61713d
parent5a0328c7b039a90e988aaab8e03eb8ce5508d62b (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.c2
-rw-r--r--system-dummy.c4
-rw-r--r--system-linux.c2
-rw-r--r--system.h1
4 files changed, 8 insertions, 1 deletions
diff --git a/device.c b/device.c
index 67e9d9a..6dc4fa9 100644
--- a/device.c
+++ b/device.c
@@ -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;
diff --git a/system.h b/system.h
index 486fe14..b3298bd 100644
--- a/system.h
+++ b/system.h
@@ -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);