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

This is a discussion on how to close a socket such that no packet will be sent by TCP to peer - Networking ; 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 ...

+ Reply to Thread
Results 1 to 3 of 3

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

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

    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


  2. Re: how to close a socket such that no packet will be sent by TCPto peer

    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

  3. Re: how to close a socket such that no packet will be sent by TCPto peer

    In article ,
    Bjorn Nuyttens 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 to Thread