Some issues in examples/udhcp/simple.script

Rolf Eike Beer eb at emlix.com
Wed Aug 14 07:50:19 UTC 2019


Hi all,

I have discovered some problems with examples/udhcp/simple.script. I know, 
it's an example, and a simplified one. Most people will still just use it 
because it works, so I would like to point out at least some things.

First, it does not really use ip. At least not if "command" does not exist. 
Fair enough, I know I have ip, so I just deleted the checks and the ifconfig 
lines.

This makes it do nothing. As I found out the culprit is this:

                if command -v ip >/dev/null; then
                        ip addr flush dev $interface
                else
                        ifconfig $interface 0.0.0.0
                fi

The difference between both cases is: ifconfig brings up the interface, ip 
with this command does not. So if you are using ip this will just send DHCP 
request to a network interface that has link down, which will not get you 
anywhere.

Greetings,

Eike
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 313 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20190814/95609cda/attachment.asc>


More information about the busybox mailing list