Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107749413
D29056.id85123.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D29056.id85123.diff
View Options
Index: sys/netinet/ip6.h
===================================================================
--- sys/netinet/ip6.h
+++ sys/netinet/ip6.h
@@ -106,6 +106,9 @@
#endif
#define IPV6_FLOWLABEL_LEN 20
+#define IPV6_DSCP(ip6) ((ntohl((ip6)->ip6_flow) >> 20) & 0xfc)
+#define IPV6_ECN(ip6) ((ntohl((ip6)->ip6_flow) >> 20) & 0x03)
+
/*
* Extension Headers
*/
Index: sys/netinet6/frag6.c
===================================================================
--- sys/netinet6/frag6.c
+++ sys/netinet6/frag6.c
@@ -554,8 +554,7 @@
q6->ip6q_ttl = IPV6_FRAGTTL;
q6->ip6q_src = ip6->ip6_src;
q6->ip6q_dst = ip6->ip6_dst;
- q6->ip6q_ecn =
- (ntohl(ip6->ip6_flow) >> 20) & IPTOS_ECN_MASK;
+ q6->ip6q_ecn = IPV6_ECN(ip6);
q6->ip6q_unfrglen = -1; /* The 1st fragment has not arrived. */
/* Add the fragemented packet to the bucket. */
@@ -688,7 +687,7 @@
* if CE is set, do not lose CE.
* Drop if CE and not-ECT are mixed for the same packet.
*/
- ecn = (ntohl(ip6->ip6_flow) >> 20) & IPTOS_ECN_MASK;
+ ecn = IPV6_ECN(ip6);
ecn0 = q6->ip6q_ecn;
if (ecn == IPTOS_ECN_CE) {
if (ecn0 == IPTOS_ECN_NOTECT) {
Index: sys/netinet6/ip6_output.c
===================================================================
--- sys/netinet6/ip6_output.c
+++ sys/netinet6/ip6_output.c
@@ -656,9 +656,9 @@
if (opt && opt->ip6po_tclass >= 0) {
int mask = 0;
- if ((ip6->ip6_flow & htonl(0xfc << 20)) == 0)
+ if (IPV6_DSCP(ip6) == 0)
mask |= 0xfc;
- if ((ip6->ip6_flow & htonl(0x03 << 20)) == 0)
+ if (IPv6_ECN(ip6) == )
mask |= 0x03;
if (mask != 0)
ip6->ip6_flow |= htonl((opt->ip6po_tclass & mask) << 20);
Index: sys/netpfil/pf/pf.c
===================================================================
--- sys/netpfil/pf/pf.c
+++ sys/netpfil/pf/pf.c
@@ -6430,7 +6430,7 @@
pd.sidx = (dir == PF_IN) ? 0 : 1;
pd.didx = (dir == PF_IN) ? 1 : 0;
pd.af = AF_INET6;
- pd.tos = (ntohl(h->ip6_flow) >> 20) & 0xfc;
+ pd.tos = IPV6_DSCP(h);
pd.tot_len = ntohs(h->ip6_plen) + sizeof(struct ip6_hdr);
off = ((caddr_t)h - m->m_data) + sizeof(struct ip6_hdr);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 11:06 PM (3 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15902586
Default Alt Text
D29056.id85123.diff (2 KB)
Attached To
Mode
D29056: net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros
Attached
Detach File
Event Timeline
Log In to Comment