svn: head/sys/netinet

Gleb Smirnoff glebius at FreeBSD.org
Fri Dec 30 20:02:52 UTC 2011


On Fri, Dec 30, 2011 at 11:23:45AM -0800, Maxim Sobolev wrote:
M> Won't this break whole lot of third-party software, which expects 
M> FreeBSD to be slightly different in this regards? Just curious.

Yes it does. And until FreeBSD 10.0-RELEASE there is time to fix
this software (at least in ports).

The MFC to stable/9 of r226105 was back out.

M> -Maxim
M> 
M> On 10/7/2011 6:43 AM, Andre Oppermann wrote:
M> > Author: andre
M> > Date: Fri Oct  7 13:43:01 2011
M> > New Revision: 226105
M> > URL: http://svn.freebsd.org/changeset/base/226105
M> >
M> > Log:
M> >    Add back the IP header length to the total packet length field on
M> >    raw IP sockets.  It was deducted in ip_input() in preparation for
M> >    protocols interested only in the payload.
M> >
M> >    On raw sockets the IP header should be delivered as it at came in
M> >    from the network except for the byte order swaps in some fields.
M> >
M> >    This brings us in line with all other OS'es that provide raw
M> >    IP sockets.
M> >
M> >    Reported by: Matthew Cini Sarreo<mcins1-at-gmail.com>
M> >    MFC after: 3 days
M> >
M> > Modified:
M> >    head/sys/netinet/raw_ip.c
M> >
M> > Modified: head/sys/netinet/raw_ip.c
M> > ==============================================================================
M> > --- head/sys/netinet/raw_ip.c	Fri Oct  7 13:16:21 2011	(r226104)
M> > +++ head/sys/netinet/raw_ip.c	Fri Oct  7 13:43:01 2011	(r226105)
M> > @@ -289,6 +289,13 @@ rip_input(struct mbuf *m, int off)
M> >   	last = NULL;
M> >
M> >   	ifp = m->m_pkthdr.rcvif;
M> > +	/*
M> > +	 * Add back the IP header length which was
M> > +	 * removed by ip_input().  Raw sockets do
M> > +	 * not modify the packet except for some
M> > +	 * byte order swaps.
M> > +	 */
M> > +	ip->ip_len += off;
M> >
M> >   	hash = INP_PCBHASH_RAW(proto, ip->ip_src.s_addr,
M> >   	    ip->ip_dst.s_addr, V_ripcbinfo.ipi_hashmask);
M> >
M> >

-- 
Totus tuus, Glebius.


More information about the svn-src-all mailing list