Subject: Re: Generating a TCP reset
To: David Brownlee <abs@absd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: tech-net
Date: 09/05/2005 18:45:15
--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Mon, Sep 05, 2005 at 10:06:16AM +0100, David Brownlee wrote:
> We're looking to test failure modes on our network app and want
> to reset an arbitrary TCP connection. Would anyone know of such a
> tool for NetBSD?
Maybe ipsend? (BTW I prevent core dumps due to my badly written input
files with the attached patch)
Cheers,
Patrick
--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=ipfpat
Index: iplang/iplang_y.y
===================================================================
RCS file: /cvsroot/src/dist/ipf/iplang/iplang_y.y,v
retrieving revision 1.7
diff -u -r1.7 iplang_y.y
--- iplang/iplang_y.y 8 Feb 2005 07:01:53 -0000 1.7
+++ iplang/iplang_y.y 5 Sep 2005 17:43:53 -0000
@@ -1290,8 +1290,13 @@
if (ifp->if_fd == -1)
ifp->if_fd = initdevice(ifp->if_name, 5);
gwip = sending.snd_gw;
- if (!gwip.s_addr)
+ if (!gwip.s_addr) {
+ if (!aniphead) {
+ fprintf(stderr, "no destination address defined for sending!\n");
+ return;
+ }
gwip = aniphead->ah_ip->ip_dst;
+ }
(void) send_ip(ifp->if_fd, ifp->if_MTU, (ip_t *)ipbuffer, gwip, 2);
}
--82I3+IH0IqGh5yIs--