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, [EMAIL PROTECTED]  . 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to