Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 2009 16:10:59 GMT
From:      Andre Oppermann <andre@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 157796 for review
Message-ID:  <200902161610.n1GGAxmM055066@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=157796

Change 157796 by andre@andre_flirtbox on 2009/02/16 16:10:48

	Better ttl and hlim initialization in tcpip_fillheaders.

Affected files ...

.. //depot/projects/tcp_new/netinet/tcp_subr.c#4 edit

Differences ...

==== //depot/projects/tcp_new/netinet/tcp_subr.c#4 (text+ko) ====

@@ -294,9 +294,8 @@
  * of the tcpcb each time to conserve mbufs.
  */
 void
-tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr)
+tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, struct tcphdr *th)
 {
-	struct tcphdr *th = (struct tcphdr *)tcp_ptr;
 
 	INP_LOCK_ASSERT(inp);
 
@@ -311,6 +310,7 @@
 			(IPV6_VERSION & IPV6_VERSION_MASK);
 		ip6->ip6_nxt = IPPROTO_TCP;
 		ip6->ip6_plen = sizeof(struct tcphdr);
+		ip6->ip6_hlim = in6_selecthlim(inp, NULL);
 		ip6->ip6_src = inp->in6p_laddr;
 		ip6->ip6_dst = inp->in6p_faddr;
 	} else
@@ -325,7 +325,12 @@
 		ip->ip_len = 0;
 		ip->ip_id = 0;
 		ip->ip_off = 0;
-		ip->ip_ttl = inp->inp_ip_ttl;
+#ifdef INET6
+		if (INP_CHECK_SOCKAF(inp->inp_socket, AF_INET6))
+			ip->ip_ttl = in6_selecthlim(inp, NULL);
+		else
+#endif
+			ip->ip_ttl = inp->inp_ip_ttl;
 		ip->ip_sum = 0;
 		ip->ip_p = IPPROTO_TCP;
 		ip->ip_src = inp->inp_laddr;



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