Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147687928
D50405.1784080480.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D50405.1784080480.diff
View Options
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -564,7 +564,7 @@
ifp = if_alloc(IFT_ETHER);
if_initname(ifp, name, unit);
ifp->if_softc = vap; /* back pointer */
- ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
+ if_setflags(ifp, IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST);
ifp->if_transmit = ieee80211_vap_transmit;
ifp->if_qflush = ieee80211_vap_qflush;
ifp->if_ioctl = ieee80211_ioctl;
diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h
--- a/sys/net80211/ieee80211_freebsd.h
+++ b/sys/net80211/ieee80211_freebsd.h
@@ -263,8 +263,8 @@
const char * ieee80211_get_vap_ifname(struct ieee80211vap *);
#define IFNET_IS_UP_RUNNING(_ifp) \
- (((_ifp)->if_flags & IFF_UP) && \
- ((_ifp)->if_drv_flags & IFF_DRV_RUNNING))
+ ((if_getflags(_ifp) & IFF_UP) && \
+ (if_getdrvflags(_ifp) & IFF_DRV_RUNNING))
#define msecs_to_ticks(ms) MSEC_2_TICKS(ms)
#define ticks_to_msecs(t) TICKS_2_MSEC(t)
@@ -543,6 +543,8 @@
void ieee80211_vap_sync_mac_address(struct ieee80211vap *);
void ieee80211_vap_copy_mac_address(struct ieee80211vap *);
void ieee80211_vap_deliver_data(struct ieee80211vap *, struct mbuf *);
+bool ieee80211_vap_check_is_monitor(struct ieee80211vap *);
+bool ieee80211_vap_check_is_simplex(struct ieee80211vap *);
#endif /* _KERNEL */
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c
--- a/sys/net80211/ieee80211_freebsd.c
+++ b/sys/net80211/ieee80211_freebsd.c
@@ -1259,6 +1259,34 @@
NET_EPOCH_EXIT(et);
}
+/**
+ * @brief Return whether the VAP is configured with monitor mode
+ *
+ * This checks the operating system layer for whether monitor mode
+ * is enabled.
+ */
+bool
+ieee80211_vap_check_is_monitor(struct ieee80211vap *vap)
+{
+ struct ifnet *ifp = vap->iv_ifp;
+
+ return !! (ifp->if_flags & IFF_MONITOR);
+}
+
+/**
+ * @brief Return whether the VAP is configured in simplex mode.
+ *
+ * This checks the operating system layer for whether simplex mode
+ * is enabled.
+ */
+bool
+ieee80211_vap_check_is_simplex(struct ieee80211vap *vap)
+{
+ struct ifnet *ifp = vap->iv_ifp;
+
+ return !! (ifp->if_flags & IFF_SIMPLEX);
+}
+
/*
* Module glue.
*
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -777,7 +777,7 @@
if (error)
senderr(error);
#endif
- if (ifp->if_flags & IFF_MONITOR)
+ if (ieee80211_vap_check_is_monitor(vap))
senderr(ENETDOWN);
if (!IFNET_IS_UP_RUNNING(ifp))
senderr(ENETDOWN);
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c
--- a/sys/net80211/ieee80211_sta.c
+++ b/sys/net80211/ieee80211_sta.c
@@ -681,7 +681,7 @@
}
resubmit_ampdu:
if (dir == IEEE80211_FC1_DIR_FROMDS) {
- if ((ifp->if_flags & IFF_SIMPLEX) &&
+ if (ieee80211_vap_check_is_simplex(vap) &&
isfromds_mcastecho(vap, wh)) {
/*
* In IEEE802.11 network, multicast
@@ -716,7 +716,7 @@
vap->iv_stats.is_rx_wrongdir++;
goto out;
}
- if ((ifp->if_flags & IFF_SIMPLEX) &&
+ if (ieee80211_vap_check_is_simplex(vap) &&
isdstods_mcastecho(vap, wh)) {
/*
* In IEEE802.11 network, multicast
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 15, 1:54 AM (16 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29137240
Default Alt Text
D50405.1784080480.diff (3 KB)
Attached To
Mode
D50405: net80211: migrate if_flags, if_drvflags out of most source files
Attached
Detach File
Event Timeline
Log In to Comment