summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-01-22 18:43:36 +0100
committerFelix Fietkau <nbd@openwrt.org>2012-01-22 18:43:36 +0100
commit91fa29a0d17b40963f67f08e740ca0a07365db90 (patch)
tree606753219fe2321062f660ba6f1017183455f9ce /system-linux.c
parentc85a502081ef76aef0a9e9fb9af65257c2e415a2 (diff)
move device settings to a separate struct
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/system-linux.c b/system-linux.c
index 2150c44..0ff2b3b 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -570,31 +570,30 @@ int system_vlan_del(struct device *dev)
}
static void
-system_if_apply_settings(struct device *dev)
+system_if_apply_settings(struct device *dev, struct device_settings *s)
{
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, dev->ifname, sizeof(ifr.ifr_name));
- if (dev->flags & DEV_OPT_MTU) {
- ifr.ifr_mtu = dev->mtu;
+ if (s->flags & DEV_OPT_MTU) {
+ ifr.ifr_mtu = s->mtu;
ioctl(sock_ioctl, SIOCSIFMTU, &ifr);
}
- if (dev->flags & DEV_OPT_TXQUEUELEN) {
- ifr.ifr_qlen = dev->txqueuelen;
+ if (s->flags & DEV_OPT_TXQUEUELEN) {
+ ifr.ifr_qlen = s->txqueuelen;
ioctl(sock_ioctl, SIOCSIFTXQLEN, &ifr);
}
- if (dev->flags & DEV_OPT_MACADDR) {
- memcpy(&ifr.ifr_hwaddr, dev->macaddr, sizeof(dev->macaddr));
+ if (s->flags & DEV_OPT_MACADDR) {
+ memcpy(&ifr.ifr_hwaddr, s->macaddr, sizeof(s->macaddr));
ioctl(sock_ioctl, SIOCSIFHWADDR, &ifr);
}
-
- dev->ifindex = system_if_resolve(dev);
}
int system_if_up(struct device *dev)
{
- system_if_apply_settings(dev);
+ system_if_apply_settings(dev, &dev->settings);
+ dev->ifindex = system_if_resolve(dev);
return system_if_flags(dev->ifname, IFF_UP, 0);
}