svn commit: r226304 - stable/9/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Wed Oct 12 15:29:51 UTC 2011
Author: tuexen
Date: Wed Oct 12 15:29:50 2011
New Revision: 226304
URL: http://svn.freebsd.org/changeset/base/226304
Log:
MFC 226252:
Use the most significant 6 bits of the dscp instead of the least
significant ones.
This has changed in the latest version of the socket API ID and
provides backwards compatibility and gets it in syn with the
usage of the IP_TOS socket option.
Approved by: re@
Modified:
stable/9/sys/netinet/sctp_usrreq.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/amd64/include/xen/ (props changed)
stable/9/sys/boot/ (props changed)
stable/9/sys/boot/i386/efi/ (props changed)
stable/9/sys/boot/ia64/efi/ (props changed)
stable/9/sys/boot/ia64/ski/ (props changed)
stable/9/sys/boot/powerpc/boot1.chrp/ (props changed)
stable/9/sys/boot/powerpc/ofw/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
stable/9/sys/conf/ (props changed)
stable/9/sys/contrib/dev/acpica/ (props changed)
stable/9/sys/contrib/octeon-sdk/ (props changed)
stable/9/sys/contrib/pf/ (props changed)
stable/9/sys/contrib/x86emu/ (props changed)
Modified: stable/9/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/9/sys/netinet/sctp_usrreq.c Wed Oct 12 15:02:06 2011 (r226303)
+++ stable/9/sys/netinet/sctp_usrreq.c Wed Oct 12 15:29:50 2011 (r226304)
@@ -2435,7 +2435,7 @@ flags_out:
paddrp->spp_flags |= SPP_PMTUD_DISABLE;
}
if (net->dscp & 0x01) {
- paddrp->spp_dscp = net->dscp >> 2;
+ paddrp->spp_dscp = net->dscp & 0xfc;
paddrp->spp_flags |= SPP_DSCP;
}
#ifdef INET6
@@ -2453,7 +2453,7 @@ flags_out:
paddrp->spp_pathmaxrxt = stcb->asoc.def_net_failure;
paddrp->spp_pathmtu = sctp_get_frag_point(stcb, &stcb->asoc);
if (stcb->asoc.default_dscp & 0x01) {
- paddrp->spp_dscp = stcb->asoc.default_dscp >> 2;
+ paddrp->spp_dscp = stcb->asoc.default_dscp & 0xfc;
paddrp->spp_flags |= SPP_DSCP;
}
#ifdef INET6
@@ -2488,7 +2488,7 @@ flags_out:
paddrp->spp_assoc_id = SCTP_FUTURE_ASSOC;
/* get inp's default */
if (inp->sctp_ep.default_dscp & 0x01) {
- paddrp->spp_dscp = inp->sctp_ep.default_dscp >> 2;
+ paddrp->spp_dscp = inp->sctp_ep.default_dscp & 0xfc;
paddrp->spp_flags |= SPP_DSCP;
}
#ifdef INET6
@@ -4691,7 +4691,7 @@ sctp_setopt(struct socket *so, int optna
net->failure_threshold = paddrp->spp_pathmaxrxt;
}
if (paddrp->spp_flags & SPP_DSCP) {
- net->dscp = paddrp->spp_dscp << 2;
+ net->dscp = paddrp->spp_dscp & 0xfc;
net->dscp |= 0x01;
}
#ifdef INET6
@@ -4794,10 +4794,10 @@ sctp_setopt(struct socket *so, int optna
}
if (paddrp->spp_flags & SPP_DSCP) {
TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
- net->dscp = paddrp->spp_dscp << 2;
+ net->dscp = paddrp->spp_dscp & 0xfc;
net->dscp |= 0x01;
}
- stcb->asoc.default_dscp = paddrp->spp_dscp << 2;
+ stcb->asoc.default_dscp = paddrp->spp_dscp & 0xfc;
stcb->asoc.default_dscp |= 0x01;
}
#ifdef INET6
@@ -4851,7 +4851,7 @@ sctp_setopt(struct socket *so, int optna
sctp_feature_on(inp, SCTP_PCB_FLAGS_DO_NOT_PMTUD);
}
if (paddrp->spp_flags & SPP_DSCP) {
- inp->sctp_ep.default_dscp = paddrp->spp_dscp << 2;
+ inp->sctp_ep.default_dscp = paddrp->spp_dscp & 0xfc;
inp->sctp_ep.default_dscp |= 0x01;
}
#ifdef INET6
More information about the svn-src-stable-9
mailing list