Bug 11691 - "udhcpc -n -b" still exits after backgrounding on no lease
Summary: "udhcpc -n -b" still exits after backgrounding on no lease
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.30.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL: https://unix.stackexchange.com/questi...
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-22 19:59 UTC by Andrey
Modified: 2019-02-27 07:32 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
Minimal .config (35.42 KB, application/octet-stream)
2019-02-22 20:56 UTC, Andrey
Details
Proposed fix (1.42 KB, patch)
2019-02-22 21:18 UTC, Andrey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey 2019-02-22 19:59:52 UTC
Running "udhcpc -n -b" causes udhcpc to go into background and then exit after some timeout unless a lease is obtained.
It's probably arguable what's the proper behavior is,
but I expect "-b" switch to override "-n" switch.

A particular use-case is managing udhcpc from ifupdown.
Currently, ifupdown passes "-n" to udhcpc by default (unless compiled with other options), and there is no way to override this without recompiling busybox.

It looks like, the code actually tries to favor "-b" over "-n", but doesn't clear "-n" flag while clearing "-b" before backgrounding.
Comment 1 Andrey 2019-02-22 20:56:18 UTC
Created attachment 7951 [details]
Minimal .config
Comment 2 Andrey 2019-02-22 21:18:03 UTC
Created attachment 7956 [details]
Proposed fix
Comment 3 Andrey 2019-02-22 21:21:17 UTC
A simple reproducer:
ip link add type veth
ip link set veth0 up
busybox udhcpc -n -i veth0 -b -S
Comment 4 Denys Vlasenko 2019-02-27 07:32:19 UTC
fixed in git:

commit 87e216294af9eec39c0c1d553555f8a98c15db38
Author: Andrey Mazo <ahippo@yandex.com>
Date:   Fri Feb 22 16:46:19 2019 -0500

    udhcpc: don't exit after backgrounding on -n -b