Networking Forums

Networking Forums > Computer Networking > Linux Networking > how to close a socket such that no packet will be sent by TCP to peer

Reply
Thread Tools Display Modes

how to close a socket such that no packet will be sent by TCP to peer

 
 
Rohit
Guest
Posts: n/a

 
      07-04-2007, 12:33 PM
Hi All,
I want a way by which application (or a kernel module working with
application) can close a socket fd
such that TCP will not try to send any pakcets over socket after that.
Not even RST,FIN, ACK.
If app can not do that , can kernel module do something. ??

The problem is also that , the IP adress that TCP connection was using
is no longer with this machine, and it should not send any packet for
that connection. I tried sending fabricated RST packets over raw
socket, but this does not work , as pakcet goes to different machine.
(which has got this machine's IP now.)

I have IP address for this machine, but do not know how i can stop
TCP from sending any packets .

Any suggestion ??

-- Rohit

 
Reply With Quote
 
 
 
 
Bjorn Nuyttens
Guest
Posts: n/a

 
      07-16-2007, 03:55 PM
Rohit wrote:
> Hi All,
> I want a way by which application (or a kernel module working with
> application) can close a socket fd
> such that TCP will not try to send any pakcets over socket after that.
> Not even RST,FIN, ACK.
> If app can not do that , can kernel module do something. ??
>
> The problem is also that , the IP adress that TCP connection was using
> is no longer with this machine, and it should not send any packet for
> that connection. I tried sending fabricated RST packets over raw
> socket, but this does not work , as pakcet goes to different machine.
> (which has got this machine's IP now.)
>
> I have IP address for this machine, but do not know how i can stop
> TCP from sending any packets .
>
> Any suggestion ??
>
> -- Rohit
>


If you do not find the solution in the man pages of close,shutdown or
setsockopt, I guess you have no other way than writing your own TCP/IP
stack using raw sockets...

Bjorn
 
Reply With Quote
 
Robert Nichols
Guest
Posts: n/a

 
      07-16-2007, 11:56 PM
In article <XxMmi.270$r%(E-Mail Removed)>,
Bjorn Nuyttens <(E-Mail Removed)> wrote:
:Rohit wrote:
:> Hi All,
:> I want a way by which application (or a kernel module working with
:> application) can close a socket fd
:> such that TCP will not try to send any pakcets over socket after that.
:> Not even RST,FIN, ACK.
:> If app can not do that , can kernel module do something. ??
:>
:> The problem is also that , the IP adress that TCP connection was using
:> is no longer with this machine, and it should not send any packet for
:> that connection. I tried sending fabricated RST packets over raw
:> socket, but this does not work , as pakcet goes to different machine.
:> (which has got this machine's IP now.)
:>
:> I have IP address for this machine, but do not know how i can stop
:> TCP from sending any packets .
:>
:> Any suggestion ??
:>
:> -- Rohit
:>
:
:If you do not find the solution in the man pages of close,shutdown or
:setsockopt, I guess you have no other way than writing your own TCP/IP
:stack using raw sockets...

Thinking a bit outside the box for a moment, how about inserting a
firewall rule to DROP any outgoing packets having a source address that
matches the old IP addr?

--
Bob Nichols AT comcast.net I am "RNichols42"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Packet socket attached to 802.11 interface? jski Wireless Internet 0 08-15-2006 07:10 PM
Help: What's the raw packet socket? bg2aw@126.com Linux Networking 1 06-30-2006 09:22 AM
Packet socket: mmapped IO cone Linux Networking 1 03-28-2006 04:50 PM
Raw socket captures only first 96 bytes of packet satishamara@yahoo.com Linux Networking 1 08-09-2005 01:55 PM
Raw socket captures only first 96 bytes of packet satishamara@yahoo.com Linux Networking 0 08-08-2005 06:32 PM



1 2 3 4 5 6 7 8 9 10 11