Date: Fri, 10 Feb 2012 23:24:34 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r231471 - stable/8/sys/netinet Message-ID: <201202102324.q1ANOYN1001605@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Fri Feb 10 23:24:34 2012 New Revision: 231471 URL: http://svn.freebsd.org/changeset/base/231471 Log: MFC r226252: 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. Modified: stable/8/sys/netinet/sctp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:24:33 2012 (r231470) +++ stable/8/sys/netinet/sctp_usrreq.c Fri Feb 10 23:24:34 2012 (r231471) @@ -2424,7 +2424,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 @@ -2442,7 +2442,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 @@ -2477,7 +2477,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 @@ -4659,7 +4659,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 @@ -4762,10 +4762,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 @@ -4819,7 +4819,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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202102324.q1ANOYN1001605>