atom feed3 messages in org.freebsd.freebsd-questionsInetd: bug or expected behaviour
FromSent OnAttachments
Ruslan ErmilovMay 18, 1998 7:23 am 
Doug WhiteMay 18, 1998 3:48 pm 
Ruslan ErmilovMay 19, 1998 12:41 am 
Subject:Inetd: bug or expected behaviour
From:Ruslan Ermilov (ru@ucb.crimea.ua)
Date:May 18, 1998 7:23:12 am
List:org.freebsd.freebsd-questions

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,

To Unsubscribe: send mail to majo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message