Re: Dropping packets, general kernel hacking (newbie questions)

Alan Cox (alan@lxorguk.ukuu.org.uk)
Fri, 22 Aug 1997 22:53:38 +0100 (BST)


> IP forwarding code for a linux router occasionally drop packets
> and/or delay them some number of milliseconds. My first attempt

I use a 3c501 ethernet card for this. Hardware crap network support.

> will be to add the code somewhere at the end of ip_forward.c,
> before the packets get put on the interface queue.

Delaying packets is extremely tricky. Tossing them is quite easy. To
toss the packet just add code to dev_queue_xmit and free the buffer
(following the path as if the driver failed the transmit). To delay
it needs some driver level tweaks - sometimes after a tx complete
leave dev->tbusy set and reset it on a timer.

Alan