[Netnice-kernels] Re: inetd on OpenBSD
Status: Alpha
Brought to you by:
taost6
From: Takashi O. <ta...@cs...> - 2004-11-14 22:17:35
|
hi scott, sorry for the slow reply. because nn_create() wraps the created process with a VIF before it does an exec call, i think that any sockets created after the exec will share the created VIF. the reason because the sockets you observed were not sharing the created VIF is probably because, they are inherited from the inetd. so, we'll need to reconnect all the sockets, probably inside nn_create(), as you suggested... 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. so, it looks like a serious bug, both in the kernel and in the inetd implementation. i appreciate your bug report, and would be happy if you take care of the linux side of the issue (both in the kernel and in the userland). best, -- taka Scott Brumbaugh wrote: > > Hi Takashi, > > I have been implementing inetd on Linux and need an explaination. I > have setup an inetd.conf as so: > > # inetd.conf > telnet stream tcp nowait root /usr/sbin/in.telnetd telnetd @10K/sec > > I start inetd and telnet into the box through eth0 (ethernet). Inetd creates > a vif in /nnfs and sets the bandwidth. > > [scottb@tamarack scottb]$ ls -lR /nnfs/network/eth0/inetd_2093/ > /nnfs/network/eth0/inetd_2093/: > total 0 > -rw-r--r-- 1 root root 0 Nov 11 14:16 bandwidth > -rw-r--r-- 1 root root 0 Nov 11 14:16 drops > -rw-r--r-- 1 root root 0 Nov 11 14:16 filter > -rw-r--r-- 1 root root 0 Nov 11 14:16 port > -rw-r--r-- 1 root root 0 Nov 11 14:16 recv > -rw-r--r-- 1 root root 0 Nov 11 14:16 send > -rw-r--r-- 1 root root 0 Nov 11 14:16 type > -rw-r--r-- 1 root root 0 Nov 11 14:16 weight > > It sets the symlink under the Pso_list directory but does not change > the symlinks under the Pso_dir fd directories, this the same as I > observe with my FreeBSD ISO version: > > [scottb@tamarack scottb]$ ls -l /nnfs/2093/sockets/ > total 0 > drwxr-xr-x 2 root root 0 Nov 11 14:22 0 > drwxr-xr-x 2 root root 0 Nov 11 14:22 1 > drwxr-xr-x 2 root root 0 Nov 11 14:22 2 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 eth0 -> ../../network/eth0/inetd_2093 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 lo -> ../../network/lo/inetd_2093 > [scottb@tamarack scottb]$ ls -lR /nnfs/2093/sockets/ > /nnfs/2093/sockets/: > total 0 > drwxr-xr-x 2 root root 0 Nov 11 14:22 0 > drwxr-xr-x 2 root root 0 Nov 11 14:22 1 > drwxr-xr-x 2 root root 0 Nov 11 14:22 2 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 eth0 -> ../../network/eth0/inetd_2093 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 lo -> ../../network/lo/inetd_2093 > > /nnfs/2093/sockets/0: > total 0 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 eth0 -> ../../../network/eth0 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 lo -> ../../../network/lo > > /nnfs/2093/sockets/1: > total 0 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 eth0 -> ../../../network/eth0 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 lo -> ../../../network/lo > > /nnfs/2093/sockets/2: > total 0 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 eth0 -> ../../../network/eth0 > lrwxr-xr-x 1 root root 0 Nov 11 14:22 lo -> ../../../network/lo > > Now, the telnet session is running but all data is passing through > the vifs attached to socket fds 0,1, and 2 which have the default bandwidth > set: > > [scottb@tamarack scottb]$ cat /nnfs/2093/sockets/0/eth0/bandwidth > 1032000 > > So the bandwidth of the telnet session is not throttled to 10K as I > think it is supposed to be. It seems that inetd should also reset the > symlinks in the socket fd directories. Now the reason I ask this is > because it seems that the FreeBSD implementation does the same thing > which does not seem right. > > I am thinking that I should add the logic into nn_create that will > set the symlinks under Pso_dir as well as under Pso_list. > > Scott Brumbaugh |