Re: [Netnice-kernels] Re: inetd on OpenBSD
Status: Alpha
Brought to you by:
taost6
From: Takashi O. <ta...@cs...> - 2004-11-17 00:10:00
|
hi, sorry for the slow reply. i will have a short business trip back to japan this weekend and have been a bit hectic. Scott Brumbaugh wrote: > > > but, i have been thinking, in such a case, all the sockets should be > > "disconnected", since the situation in which sockets are connected to > > a VIF which is a parent of the process which accommodates the sockets > > is a violation of the VIF association rule. > > > > This is not clear to me. In inetd all the sockets are inherited by > the child but they are closed (disconnected) in the inetd parent. All > that I see as being incorrect is that the inherited sockets are not > linked to the correct VIF in the child process. I only see this as an > inetd problem. Maybe you can explain the error in my understanding as I > don't see this as a problem in the netnice internals. > > The behavior that I observe in both Linux and FreeBSD is that when a > process creates sockets, the sockets are attached to a copy of that > process's associated VIF. When a new process is created it inherits > the parents process VIF. A process can change its associated VIF but > this will not change the VIF association of any sockets currently in > existence. Only new sockets will be connected to the new process VIF. > > If a process wants a socket to be associated with a specific VIF it > needs to either explicitly set the symlink in Pso_dir or it must first > attach the VIF as its process specific VIF as a symlink under Pso_list > and then create the socket. > > Looking at what you wrote, are you saying that when a process does the > symlink operation in Pso_list that all the sockets under Pso_dir need > to be reattached as well? i think yes. all the sockets are connected to VIFs, which are the process- attached VIF or its descendants. otherwise, it violates the protection rule. to avoid sudden disconnection, it is programs responsibility, to reconnect the sockets-VIF association first, before reconnects the process-VIF association. > I have added the vifctl perl script to the userspace tools under > netnice/linux. The changes consisted of a lookup in /etc/mtab for the > nnfs mount point, and a lookup in /proc/<pid>/exe for the processes > executable file name. I have also added code to have inetd create the > symlinks under the socket fd directories as discussed previously. > These changes are conditionally deactivated now because they are > causing crashes when enabled. I do not know what is wrong at this > point. this sounds good. thaks. > I have also committed bug fix changes to NNFS. One change is a work > around that appears to prevent the intermittent crashes that where > occurring in pvif_lookup. This change affects the pvif returned from > the lookup of a TCP socket. Now a pvif will only be returned when a > TCP socket is in the ESTABLISHED state. ah. i have never thought about this issue. Linux may have different semantics of socket lookup. we will check the BSD part. thanks for the report. best, -- taka |