[MINI2440] Updated defconfig to add (optional) packages
[openwrt/mini2440.git] / package / hostapd / patches / 100-madwifi_fix.patch
blob8f8be442b90877102c827adee760f3f5a0bb39a2
1 --- a/hostapd/driver_madwifi.c
2 +++ b/hostapd/driver_madwifi.c
3 @@ -312,6 +312,7 @@ madwifi_set_iface_flags(void *priv, int
5 struct madwifi_driver_data *drv = priv;
6 struct ifreq ifr;
7 + short flags;
9 wpa_printf(MSG_DEBUG, "%s: dev_up=%d", __func__, dev_up);
11 @@ -326,10 +327,14 @@ madwifi_set_iface_flags(void *priv, int
12 return -1;
15 + flags = ifr.ifr_flags;
16 if (dev_up)
17 - ifr.ifr_flags |= IFF_UP;
18 + flags |= IFF_UP;
19 else
20 - ifr.ifr_flags &= ~IFF_UP;
21 + flags &= ~IFF_UP;
23 + if (flags == ifr.ifr_flags)
24 + return 0;
26 if (ioctl(drv->ioctl_sock, SIOCSIFFLAGS, &ifr) != 0) {
27 perror("ioctl[SIOCSIFFLAGS]");