aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_bsd.c
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@FreeBSD.org>2013-08-07 07:54:16 (GMT)
committerJouni Malinen <j@w1.fi>2013-08-07 07:54:16 (GMT)
commitcb76af8a35a46146fbc324d28b06c50317c7197b (patch)
tree353d39e2768263d96d21c10a3c9ffb67d505f3c9 /src/drivers/driver_bsd.c
parent7239ea7f0188474a88dedbf78177232fcf727977 (diff)
downloadhostap-cb76af8a35a46146fbc324d28b06c50317c7197b.zip
hostap-cb76af8a35a46146fbc324d28b06c50317c7197b.tar.gz
hostap-cb76af8a35a46146fbc324d28b06c50317c7197b.tar.bz2
bsd: Skip SIOCSIFFFLAGS ioctl when there is no change.
Don't issue SIOCSIFFLAGS if the interface is already up or already down. Signed-hostap: Rui Paulo <rpaulo@FreeBSD.org>
Diffstat (limited to 'src/drivers/driver_bsd.c')
-rw-r--r--src/drivers/driver_bsd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index 9d869b1..a80a9ac 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -265,10 +265,15 @@ bsd_ctrl_iface(void *priv, int enable)
return -1;
}
- if (enable)
+ if (enable) {
+ if (ifr.ifr_flags & IFF_UP)
+ return 0;
ifr.ifr_flags |= IFF_UP;
- else
+ } else {
+ if (!(ifr.ifr_flags & IFF_UP))
+ return 0;
ifr.ifr_flags &= ~IFF_UP;
+ }
if (ioctl(drv->sock, SIOCSIFFLAGS, &ifr) < 0) {
perror("ioctl[SIOCSIFFLAGS]");