udhcpc is disrespecting --retries, unless -n is passed as well

Denys Vlasenko vda.linux at googlemail.com
Thu Aug 8 10:35:37 UTC 2013


On Thu, Aug 8, 2013 at 10:28 AM, John Spencer
<maillist-busybox at barfooze.de> wrote:
>> The "-t N" option doesn't say how many times to try acquiring
>> the lease before exiting. It says how many discover packets to send.
>>
>>> this is pretty counterintuitive.
>>
>>
>> How would you rephrase the help text to make it clearer?#
>
>
> maybe something like this:
> -t,--retries N          Send up to N discover packets (add -n to exit after
> N failures)

I changed --help to read like this:

Usage: udhcpc [-fbqvaoCRB] [-t N] [-T SEC] [-A SEC/-n]
	[-i IFACE] [-P PORT] [-r IP] [-s PROG] [-p PIDFILE]
	[-V VENDOR] [-x OPT:VAL]... [-O OPT]...

	-i,--interface IFACE	Interface to use (default eth0)
	-p,--pidfile FILE	Create pidfile
	-s,--script PROG	Run PROG at DHCP events (default
/usr/share/udhcpc/default.script)
	-B,--broadcast		Request broadcast replies
	-t,--retries N		Send up to N discover packets (default 3)
	-T,--timeout SEC	Pause between packets (default 3)
	-A,--tryagain SEC	Wait after failure (default 20)
	-n,--now		Exit if lease is not obtained
	-q,--quit		Exit after obtaining lease
	-R,--release		Release IP on exit
	-f,--foreground		Run in foreground
	-b,--background		Background if lease is not obtained
	-S,--syslog		Log to syslog too
	-P,--client-port PORT	Use PORT (default 68)
	-a,--arping		Use arping to validate offered address
	-O,--request-option OPT	Request option OPT from server (cumulative)
	-o,--no-default-options	Don't request any options (unless -O is given)
	-r,--request IP		Request this IP address
	-x OPT:VAL		Include option OPT in sent packets (cumulative)
				Examples of string, numeric, and hex byte opts:
				-x hostname:bbox - option 12
				-x lease:3600 - option 51 (lease time)
				-x 0x3d:0100BEEFC0FFEE - option 61 (client id)
	-F,--fqdn NAME		Ask server to update DNS mapping for NAME
	-V,--vendorclass VENDOR	Vendor identifier (default 'udhcp VERSION')
	-C,--clientid-none	Don't send MAC as client identifier
	-v			Verbose
Signals:
	USR1	Renew lease
	USR2	Release lease



the "[-A SEC/-n]" part, hopefully, shows that either retry or exit
after failure can be specified.


More information about the busybox mailing list