From owner-freebsd-questions Mon May 18 07:25:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA17449 for freebsd-questions-outgoing; Mon, 18 May 1998 07:25:13 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from relay.ucb.crimea.ua (relay.ucb.crimea.ua [194.93.177.113]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA17129 for ; Mon, 18 May 1998 07:23:59 -0700 (PDT) (envelope-from ru@ucb.crimea.ua) Received: (from ru@localhost) by relay.ucb.crimea.ua (8.8.8/8.8.8) id RAA14821; Mon, 18 May 1998 17:23:34 +0300 (EEST) (envelope-from ru) Message-ID: <19980518172333.A14723@ucb.crimea.ua> Date: Mon, 18 May 1998 17:23:33 +0300 From: Ruslan Ermilov To: questions@FreeBSD.ORG Subject: Inetd: bug or expected behaviour Mail-Followup-To: questions@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91i X-Operating-System: FreeBSD 2.2.6-STABLE i386 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi! Currently I'm running FreeBSD 2.2.6-STABLE (last world at May, 13). Is the following a bug or expected behaviour? The Problem: =========== Recently I've switched from bootp to isc-dhcp2. They both listen on udp port 67, and I had the standard entry for bootpd in my inetd.conf: bootps dgram udp wait root /usr/libexec/bootpd bootpd When I've finished with DHCP configuration file (dhcpd.conf), I (as usually) commented out the string for ``bootpd'' above in inetd.conf, killed -HUP inetd, and tried to run dhcpd. I was unable to run it with the following diagnostic: ``Unable to bind, address already in use''. There was no bootpd process, and even when I killed inetd itself, the dhcpd was unable to bind to the 67 port. How-To-Repeat: ============= 1. Create a simple program which just does nothing (I called it test.sh) and put in in /tmp: #!/bin/sh while :; do sleep 1000; done 2. Add an entry for bootps in inetd.conf: bootps dgram udp wait root /tmp/test.sh test.sh (Substitute for ``bootps'' any UDP service you wish). 3. Restart inetd by killing -HUP it. 4. Send something to this port. I used the netcat (from the ports/net) for this purpose: echo xxxxxxxxxxxxxxx | nc -u localhost bootps 5. ``netstat -an -finet'' will show the string similar to this one: udp 618 0 0 *.68 *.* (Receive queue size is 618 bytes). 6. Comment the line for bootpd in /etc/inetd.conf, restart inetd. 7. Kill the test.sh process. 8. Try to bind to the port again. You'll get the ``Address already in use'' error; ``netstat -an'' still shows the line as above (step 5). Workaround: ========== Wait some time (what exact?) until the kernel purges the receive queue. Thanks in advance, -- Ruslan Ermilov System Administrator ru@ucb.crimea.ua United Commercial Bank +380-652-247647 Simferopol, Crimea 2426679 ICQ Network, UIN To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message