From owner-svn-src-all@FreeBSD.ORG Sun Jun 7 22:06:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 567811065670; Sun, 7 Jun 2009 22:06:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A4C78FC0C; Sun, 7 Jun 2009 22:06:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n57M6GUD006999; Sun, 7 Jun 2009 22:06:16 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57M6GVS006998; Sun, 7 Jun 2009 22:06:16 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906072206.n57M6GVS006998@svn.freebsd.org> From: Sam Leffler Date: Sun, 7 Jun 2009 22:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193658 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 22:06:16 -0000 Author: sam Date: Sun Jun 7 22:06:15 2009 New Revision: 193658 URL: http://svn.freebsd.org/changeset/base/193658 Log: teach ieee80211_classify about ipv6 packets Reviewed by: bz, rrs Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Jun 7 22:03:25 2009 (r193657) +++ head/sys/net80211/ieee80211_output.c Sun Jun 7 22:06:15 2009 (r193658) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_wlan.h" #include @@ -61,6 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#ifdef INET6 +#include +#endif #include @@ -730,13 +734,13 @@ ieee80211_classify(struct ieee80211_node v_wme_ac = TID_TO_WME_AC(EVL_PRIOFTAG(ni->ni_vlan)); } + /* XXX m_copydata may be too slow for fast path */ #ifdef INET if (eh->ether_type == htons(ETHERTYPE_IP)) { uint8_t tos; /* * IP frame, map the DSCP bits from the TOS field. */ - /* XXX m_copydata may be too slow for fast path */ /* NB: ip header may not be in first mbuf */ m_copydata(m, sizeof(struct ether_header) + offsetof(struct ip, ip_tos), sizeof(tos), &tos); @@ -744,7 +748,25 @@ ieee80211_classify(struct ieee80211_node d_wme_ac = TID_TO_WME_AC(tos); } else { #endif /* INET */ +#ifdef INET6 + if (eh->ether_type == htons(ETHERTYPE_IPV6)) { + uint32_t flow; + uint8_t tos; + /* + * IPv6 frame, map the DSCP bits from the TOS field. + */ + m_copydata(m, sizeof(struct ether_header) + + offsetof(struct ip6_hdr, ip6_flow), sizeof(flow), + (caddr_t) &flow); + 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 + } +#endif #ifdef INET } #endif