Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143582173
D36411.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36411.diff
View Options
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
@@ -1269,9 +1269,14 @@
v_wme_ac = TID_TO_WME_AC(EVL_PRIOFTAG(ni->ni_vlan));
}
+ if (eh == NULL)
+ goto no_eh;
+
/* XXX m_copydata may be too slow for fast path */
+ switch (ntohs(eh->ether_type)) {
#ifdef INET
- if (eh && eh->ether_type == htons(ETHERTYPE_IP)) {
+ case ETHERTYPE_IP:
+ {
uint8_t tos;
/*
* IP frame, map the DSCP bits from the TOS field.
@@ -1281,10 +1286,12 @@
offsetof(struct ip, ip_tos), sizeof(tos), &tos);
tos >>= 5; /* NB: ECN + low 3 bits of DSCP */
d_wme_ac = TID_TO_WME_AC(tos);
- } else {
-#endif /* INET */
+ break;
+ }
+#endif
#ifdef INET6
- if (eh && eh->ether_type == htons(ETHERTYPE_IPV6)) {
+ case ETHERTYPE_IPV6:
+ {
uint32_t flow;
uint8_t tos;
/*
@@ -1296,15 +1303,15 @@
tos = (uint8_t)(ntohl(flow) >> 20);
tos >>= 5; /* NB: ECN + low 3 bits of DSCP */
d_wme_ac = TID_TO_WME_AC(tos);
- } else {
-#endif /* INET6 */
- d_wme_ac = WME_AC_BE;
-#ifdef INET6
+ break;
}
#endif
-#ifdef INET
+ default:
+no_eh:
+ d_wme_ac = WME_AC_BE;
+ break;
}
-#endif
+
/*
* Use highest priority AC.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 31, 11:44 PM (7 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28219977
Default Alt Text
D36411.diff (1 KB)
Attached To
Mode
D36411: net80211: simplify an #ifdef INET/INET6 block
Attached
Detach File
Event Timeline
Log In to Comment