From owner-freebsd-bugs@FreeBSD.ORG Sat Jan 17 20:30:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02DE610656FE for ; Sat, 17 Jan 2009 20:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D1B918FC20 for ; Sat, 17 Jan 2009 20:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HKU1GX082296 for ; Sat, 17 Jan 2009 20:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n0HKU1eU082293; Sat, 17 Jan 2009 20:30:01 GMT (envelope-from gnats) Resent-Date: Sat, 17 Jan 2009 20:30:01 GMT Resent-Message-Id: <200901172030.n0HKU1eU082293@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alfred Perlstein Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17FDC106564A for ; Sat, 17 Jan 2009 20:25:30 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E013C8FC12 for ; Sat, 17 Jan 2009 20:25:29 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from freefall.freebsd.org (alfred@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n0HKPTpq082236 for ; Sat, 17 Jan 2009 20:25:29 GMT (envelope-from alfred@freefall.freebsd.org) Received: (from alfred@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n0HKPT8V082235; Sat, 17 Jan 2009 20:25:29 GMT (envelope-from alfred) Message-Id: <200901172025.n0HKPT8V082235@freefall.freebsd.org> Date: Sat, 17 Jan 2009 20:25:29 GMT From: Alfred Perlstein To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/130657: ipv6 bugfix, need review. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alfred Perlstein List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2009 20:30:02 -0000 >Number: 130657 >Category: kern >Synopsis: ipv6 bugfix, need review. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 17 20:30:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Alfred Perlstein >Release: FreeBSD 7.1-PRERELEASE i386 >Organization: Juniper Networks >Environment: System: FreeBSD freefall.freebsd.org 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #36: Mon Dec 29 15:15:30 UTC 2008 simon@freefall.freebsd.org:/usr/src/sys/i386/compile/FREEFALL i386 >Description: This is in a private version of FreeBSD we have, but the code seems to be somewhat close to what we have in FreeBSD. >How-To-Repeat: Source inspection, see email audit trail for more information. >Fix: Index: bsd/sys/netinet/tcp_syncache.c =================================================================== RCS file: /cvs/junos-2008/bsd/sys/netinet/tcp_syncache.c,v retrieving revision 1.24 diff -p -u -r1.24 tcp_syncache.c --- bsd/sys/netinet/tcp_syncache.c 29 Jul 2008 17:07:43 -0000 1.24 +++ bsd/sys/netinet/tcp_syncache.c 16 Dec 2008 19:23:31 -0000 @@ -1271,6 +1271,7 @@ syncache_respond(sc, m) struct inpcb *inp; #ifdef INET6 struct ip6_hdr *ip6 = NULL; + int inp_tclass; #endif struct rt_nexthop *minmtu_nh; struct route_table *rtb = NULL; @@ -1387,6 +1388,12 @@ syncache_respond(sc, m) /* ip6_hlim is set after checksum */ ip6->ip6_flow &= ~IPV6_FLOWLABEL_MASK; ip6->ip6_flow |= sc->sc_flowlabel; + /* Set the TC for IPv6 just like TOS for IPv4 */ + ip6->ip6_flow &= ~IPV6_CLASS_MASK; + if (inp) { + inp_tclass = IPV6_GET_CLASS(inp->in6p_flowinfo); + ip6->ip6_flow |= IPV6_SET_CLASS(inp_tclass); + } th = (struct tcphdr *)(ip6 + 1); } else >Release-Note: >Audit-Trail: >Unformatted: