Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2001 10:43:20 -0800 (PST)
From:      Luigi Rizzo <rizzo@aciri.org>
To:        dg@root.com
Cc:        rizzo@aciri.org, net@FreeBSD.ORG
Subject:   Re: dubious code in ip_output() ?
Message-ID:  <200101241843.f0OIhKQ09772@iguana.aciri.org>
In-Reply-To: <200101241821.KAA23133@implode.root.com> from David Greenman at "Jan 24, 2001 10:21:14 am"

next in thread | previous in thread | raw e-mail | index | archive | help
David,


you are absolutely right that the code was correct at the time
it was committed -- i think i tried to mention this.

The question is where to move it now. Because it seems to be only
necessary when we have fragmentation, perhaps the correct place is
somewhere near the place where fragments are created (around line
830 in 4.2):

        len = (ifp->if_mtu - hlen) &~ 7;
        if (len < 8) {
                error = EMSGSIZE;
                goto bad;
        }
---> move check here <----
        /*
         * if the interface will not calculate checksums on
         * fragmented packets, then do it here.
         */

so we get as much error reports as possible -- what do you think ?

(as a side note -- ALTQ might have problem with code peeking at
queue occupation, but that is not an easy problem to solve anyways...
reminds me of some problems related to IP-over-ATM...)

	cheers
	luigi

> >the change attached at the end was applied to ip_output()
> >long ago -- it checks for room in the interface queue early
...
> >Maybe none of these things were there at the time this code
> >was committed, but it sounds like we should remove it now.
...
> >Opinions ?
> 
>    The original problem that was being solved is that the code would start
> queuing fragments of a large packet to the output queue and then notice that
> it was full and discard the remaining fragments. This resulted in completely
> useless packet fragments being output on the wire (fragments that would never
> form a complete packet). You can imagine the various problems that this
> causes.
>    So the code can't be removed, but it could be moved a bit later, perhaps.
> It was at the correct location at the time that I wrote it, however.
> 
> -DG

----------------------------------+-----------------------------------------
 Luigi RIZZO, luigi@iet.unipi.it  . ACIRI/ICSI (on leave from Univ. di Pisa)
 http://www.iet.unipi.it/~luigi/  . 1947 Center St, Berkeley CA 94704
 Phone: (510) 666 2927
----------------------------------+-----------------------------------------


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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