diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-07-12 23:25:21 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-07-12 23:25:21 +0200 |
commit | e4285cdc1bda303b01bbf2a43340d3f40f477820 (patch) | |
tree | 616ece985939699ba363a52da81162785918cf44 /system-linux.c | |
parent | f096d021fb4119a449a7980e1667c2033491dba7 (diff) |
expose system_if_apply_settings, make it ignore the mac address for external devices
Diffstat (limited to 'system-linux.c')
-rw-r--r-- | system-linux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system-linux.c b/system-linux.c index d2e3d06..b3b58be 100644 --- a/system-linux.c +++ b/system-linux.c @@ -632,7 +632,7 @@ system_if_get_settings(struct device *dev, struct device_settings *s) } } -static void +void system_if_apply_settings(struct device *dev, struct device_settings *s) { struct ifreq ifr; @@ -649,7 +649,7 @@ system_if_apply_settings(struct device *dev, struct device_settings *s) if (ioctl(sock_ioctl, SIOCSIFTXQLEN, &ifr) < 0) s->flags &= ~DEV_OPT_TXQUEUELEN; } - if (s->flags & DEV_OPT_MACADDR) { + if ((s->flags & DEV_OPT_MACADDR) && !dev->external) { ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; memcpy(&ifr.ifr_hwaddr.sa_data, s->macaddr, sizeof(s->macaddr)); if (ioctl(sock_ioctl, SIOCSIFHWADDR, &ifr) < 0) |