Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Aug 2005 21:41:24 -0700
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        Minh Tran <mtran@groupwise.swin.edu.au>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Kernel code of reseting/ignoring tcp SYN packets
Message-ID:  <20050810044124.GE62369@funkthat.com>
In-Reply-To: <s2f52ee3.024@groupwise.swin.edu.au>
References:  <s2f52ee3.024@groupwise.swin.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Minh Tran wrote this message on Sat, Aug 06, 2005 at 21:42 +1000:
> I was looking around for the files of Kernel code where SYN messages are sent,
> so we can simply inject some code to send back a reset messages or ignore the SYN requests.

You should probably simply look at ipfw...  you can match outgoing syn
requests with something like:
ipfw add deny ip from any to any out setup

> I am having a bit of trouble in finding out the way of injecting code in the kernel to deal with SYN packets. 
> I am thinking of using ipfw to either reset or drop SYN packets.
> 
> Would anyone have some hints on the clean way of injecting some code to deal with SYN packets 
> or could you give me some ideas on which files i should look at? I really appreciate that.
> I saw some promising files in src/sys/netinet but they are not all clear in my mind.

The file that does the sending of SYN packets is sys/netinet/tcp_output.c
in the function tcp_output...  but I'd highly recommend you look at ipfw
or divert sockets...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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