From owner-svn-src-head@FreeBSD.ORG Fri Dec 30 19:59:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4124E106564A; Fri, 30 Dec 2011 19:59:16 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (mail.sippysoft.com [4.59.13.245]) by mx1.freebsd.org (Postfix) with ESMTP id 188558FC14; Fri, 30 Dec 2011 19:59:15 +0000 (UTC) Received: from s0106005004e13421.vs.shawcable.net ([70.71.175.212] helo=[192.168.1.79]) by mail.sippysoft.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.72 (FreeBSD)) (envelope-from ) id 1Rgi3T-000DJP-UJ; Fri, 30 Dec 2011 11:23:52 -0800 Message-ID: <4EFE0FC1.6070909@FreeBSD.org> Date: Fri, 30 Dec 2011 11:23:45 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Andre Oppermann References: <201110071343.p97Dh1c9013228@svn.freebsd.org> In-Reply-To: <201110071343.p97Dh1c9013228@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn: head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 19:59:16 -0000 Won't this break whole lot of third-party software, which expects FreeBSD to be slightly different in this regards? Just curious. -Maxim On 10/7/2011 6:43 AM, Andre Oppermann wrote: > Author: andre > Date: Fri Oct 7 13:43:01 2011 > New Revision: 226105 > URL: http://svn.freebsd.org/changeset/base/226105 > > Log: > Add back the IP header length to the total packet length field on > raw IP sockets. It was deducted in ip_input() in preparation for > protocols interested only in the payload. > > On raw sockets the IP header should be delivered as it at came in > from the network except for the byte order swaps in some fields. > > This brings us in line with all other OS'es that provide raw > IP sockets. > > Reported by: Matthew Cini Sarreo > MFC after: 3 days > > Modified: > head/sys/netinet/raw_ip.c > > Modified: head/sys/netinet/raw_ip.c > ============================================================================== > --- head/sys/netinet/raw_ip.c Fri Oct 7 13:16:21 2011 (r226104) > +++ head/sys/netinet/raw_ip.c Fri Oct 7 13:43:01 2011 (r226105) > @@ -289,6 +289,13 @@ rip_input(struct mbuf *m, int off) > last = NULL; > > ifp = m->m_pkthdr.rcvif; > + /* > + * Add back the IP header length which was > + * removed by ip_input(). Raw sockets do > + * not modify the packet except for some > + * byte order swaps. > + */ > + ip->ip_len += off; > > hash = INP_PCBHASH_RAW(proto, ip->ip_src.s_addr, > ip->ip_dst.s_addr, V_ripcbinfo.ipi_hashmask); > >