Re: How to find a certain socket?



2006/9/21, Robert Watson <rwatson@xxxxxxxxxxx>:


What are you trying to do, exactly?


The idea is the following: I have a module which replaces the "socket"
system call with my own "extended" socket syscall which adds some
restrictions for "socket" callers. After my module is kldloaded - some
processes/users/domains become restricted in creation of some type of
TCP/UDP sockets. This part is quite obvious. But I also want to handle
the situation when a restricted process has created a sockets _before_
my module was loaded. So I want to close its sockets so the process
will have to recreate them passing through my restriction policy this
time.

> And the second question: whats the correct way to close the socket which was
> found?

I'm not sure there's really a "correct" way to go about ripping a socket out
from under an application. tcpkill does the next closest thing, which is to
simulate a RST on the TCP connection and force it to close, which is
propagated up the stack in a way the application will understand.

As I understand, RST will take effect only for the client side
sockets but the server side "listening" socket still will be alive
awaiting for another connections. And I want to be able to close
sockets of both server and client types (sure if they were created by
my restricted process mentioned above).



Taras Danko
--
contact me:
email: gortaur@xxxxxxxxx
icq: 166956956
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Example: Socket code (Was Re: ClientServer App)
    ... protocol, such as HTTP, as your application middleware backbone?". ... control of the server with Flash Data Management Services?" ... just enter an asterix "*" for the Queue Name and then click ... thought was to use sockets with xml-rpc but then thought there has to ...
    (comp.lang.java.programmer)
  • Re: Asynchronous socket programming vs. remoting
    ... You are the first person that said I should use sockets. ... them quicker than I can load them from my harddrive using the file system. ... It scales nice too - I tried throwing 400 requests at the server in a span ... > do not need the same assembly on the client and server. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: sockets and pipes....
    ... > I have a master process that communicates with a whole bunch of hardware ... > I've been playing with named pipes and sockets but I can't help but think ... What we did was to have an instance of a process called an Interface Server ... I would have a process waiting for each sensor (and perhaps ...
    (comp.os.linux.misc)
  • Re: sockets and pipes....
    ... > I have a master process that communicates with a whole bunch of hardware ... > I've been playing with named pipes and sockets but I can't help but think ... What we did was to have an instance of a process called an Interface Server ... I would have a process waiting for each sensor (and perhaps ...
    (comp.os.linux.development.system)
  • Socket communication on multihomed box
    ... I'm building a kind of server which is supposed to handle ... The thing is that connection MUST always stay open. ... as for sockets, I'm using native syscalls, not MFC. ... Another thing is that is should work both under Linux and Windows. ...
    (microsoft.public.win32.programmer.networks)