Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2009 20:25:29 GMT
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/130657: ipv6 bugfix, need review.                                         
Message-ID:  <200901172025.n0HKPT8V082235@freefall.freebsd.org>
Resent-Message-ID: <200901172030.n0HKU1eU082293@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901172025.n0HKPT8V082235>