From owner-p4-projects@FreeBSD.ORG Mon Feb 16 16:10:59 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 87C391065672; Mon, 16 Feb 2009 16:10:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46834106566B for ; Mon, 16 Feb 2009 16:10:59 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 35B118FC17 for ; Mon, 16 Feb 2009 16:10:59 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GGAxLb055068 for ; Mon, 16 Feb 2009 16:10:59 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GGAxmM055066 for perforce@freebsd.org; Mon, 16 Feb 2009 16:10:59 GMT (envelope-from andre@freebsd.org) Date: Mon, 16 Feb 2009 16:10:59 GMT Message-Id: <200902161610.n1GGAxmM055066@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 157796 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:11:00 -0000 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;