[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    udhcpd wait for interface has an ip
From:       "Roberto A. Foglietta" <roberto.foglietta () gmail ! com>
Date:       2023-08-09 21:42:38
Message-ID: CAJGKYO4Dkfj4MNg_YLsAs+_aZns21yMvHO=5N4eTtc=fOaL66g () mail ! gmail ! com
[Download RAW message or body]

Hi all,

 I am dealing with busybox udhcpd and I discovered that there is not
an option that makes this daemon - especially in combination with -f
option - wait until the interface receives an IP. Something like -w,
for example.

 At the moment, I solved in this way:

ExecStartPre=/bin/sh -c "while ! /usr/sbin/ip -4 a | /bin/grep -q
rndis0:; do /bin/sleep 1; done"

 However, this implies to use --no-block with systemctl re/start and
it is a potentially critical shortcoming because this option is not
the default.

udhcpd: is interface rndis0 up and configured?: Cannot assign requested address

 I am puzzled because I think that it is not an uncommon issue waiting
for an interface that will come up soon or later. Moreover, at first
glance, it would not a pain to add that option in
networking/udhcp/dhcpd.c:958

== untested and uncompiled code, just for example ==

again:
    if (udhcp_read_interface(server_data.interface,
            &server_data.ifindex,
            (server_data.server_nip == 0 ? &server_data.server_nip : NULL),
            server_data.server_mac)
    ) {
        if(wait_for_interface) {
            sleep(1);
            goto again;
        }
        retval = 1;
        goto ret;
    }

Possibly, I have overlooked something. Otherwise, I can implement this
feature. Just let me know.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic