projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1466967
)
remove flags for device settings that could not be applied successfully
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 22 Jan 2012 18:11:19 +0000
(19:11 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 22 Jan 2012 18:11:24 +0000
(19:11 +0100)
system-linux.c
patch
|
blob
|
history
diff --git
a/system-linux.c
b/system-linux.c
index
34d7cae
..
aa3aeda
100644
(file)
--- a/
system-linux.c
+++ b/
system-linux.c
@@
-602,15
+602,18
@@
system_if_apply_settings(struct device *dev, struct device_settings *s)
strncpy(ifr.ifr_name, dev->ifname, sizeof(ifr.ifr_name));
if (s->flags & DEV_OPT_MTU) {
ifr.ifr_mtu = s->mtu;
strncpy(ifr.ifr_name, dev->ifname, sizeof(ifr.ifr_name));
if (s->flags & DEV_OPT_MTU) {
ifr.ifr_mtu = s->mtu;
- ioctl(sock_ioctl, SIOCSIFMTU, &ifr);
+ if (ioctl(sock_ioctl, SIOCSIFMTU, &ifr) < 0)
+ s->flags &= ~DEV_OPT_MTU;
}
if (s->flags & DEV_OPT_TXQUEUELEN) {
ifr.ifr_qlen = s->txqueuelen;
}
if (s->flags & DEV_OPT_TXQUEUELEN) {
ifr.ifr_qlen = s->txqueuelen;
- ioctl(sock_ioctl, SIOCSIFTXQLEN, &ifr);
+ if (ioctl(sock_ioctl, SIOCSIFTXQLEN, &ifr) < 0)
+ s->flags &= ~DEV_OPT_TXQUEUELEN;
}
if (s->flags & DEV_OPT_MACADDR) {
memcpy(&ifr.ifr_hwaddr, s->macaddr, sizeof(s->macaddr));
}
if (s->flags & DEV_OPT_MACADDR) {
memcpy(&ifr.ifr_hwaddr, s->macaddr, sizeof(s->macaddr));
- ioctl(sock_ioctl, SIOCSIFHWADDR, &ifr);
+ if (ioctl(sock_ioctl, SIOCSIFHWADDR, &ifr) < 0)
+ s->flags &= ~DEV_OPT_MACADDR;
}
}
}
}