Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2009 12:44:18 -0800
From:      Alfred Perlstein <alfred@freebsd.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/130657: ipv6 bugfix, need review.
Message-ID:  <20090117204418.GU60686@elvis.mu.org>

next in thread | raw e-mail | index | archive | help
Recording mailing list conversation into gnats.

----- Forwarded message from Alfred Perlstein <alfred@freebsd.org> -----

From: Alfred Perlstein <alfred@freebsd.org>
To: net@freebsd.org
Cc: 
Subject: ipv6 bugfix, need review.
Date: Mon, 22 Dec 2008 16:12:16 -0800
Message-ID: <20081223001216.GH18389@elvis.mu.org>
User-Agent: Mutt/1.4.2.3i
Sender: owner-freebsd-net@freebsd.org

Hey guys, we found a bug at Juniper and it resolves an issue
for us.  I've been asked to forward this to FreeBSD, I honestly
am not that clear on the issue so I'm hoping someone can step
up to review this.

Synopsis is:

  The traffic class byte is set to 0x00000000 in the header of some
  BGP packets sent between interfaces that have IPv6 addresses,
  instead of the correct setting 0xc0 (INTERNETCONTROL).

Fix is small and attached.  One thing I am wondering, do we
need to check "if (inp)" ?  I don't think so.

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


-- 
- Alfred Perlstein
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"

----- End forwarded message -----

-- 
- Alfred Perlstein



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