dhcpcd-discuss

Re: Can dhcpcd run DISCOVER immeditaly instead of requesting the current IP

Kobi Cohen-Arazi

Thu Apr 04 21:08:08 2013

BTW,

From reboot code in dhcpcd.c:
void
start_reboot(struct interface *iface)
{
        struct if_options *ifo = iface->state->options;

        if (ifo->options & DHCPCD_LINK && iface->carrier == LINK_DOWN) {
                syslog(LOG_INFO, "%s: waiting for carrier", iface->name);
                return;
        }
        if (ifo->options & DHCPCD_STATIC) {
                start_static(iface);
                return;
        }
        if (ifo->reboot == 0 || iface->state->offer == NULL) {
                start_discover(iface);
                return;
        }
....

seems like dhcpcd/if-options.c has the following:
        case 'y':
                ifo->reboot = atoint(arg);
                if (ifo->reboot < 0) {
                        syslog(LOG_ERR, "reboot must be a positive value");
                        return -1;
                }
                break;


Does it make sense to add -y1 to dhcocd cmd line args to force discover
after reboot?

Thanks,
Kobi

- Kobi

        0
    ----
 _ `\ <,_
(*) /   (*)


On Thu, Apr 4, 2013 at 1:42 PM, Kobi Cohen-Arazi
<kobi.cohenarazi@xxxxxxxxx>wrote:

> Hi Folks,
>
> Question - I have a scenario, where I would like to request a new IP (but
> not to renew it).
> In this scenario, I stop dhcpcd before running a new DHCP request.
> The platform is Android (recent JB) and from what I see, dhcpcd take the
> current IP (not sure where does it take it from, maybe from
> dhcp.wlan0.ipaddress system property ?) and use this IP in the request
> packet.
> In this specific scenario, the target DHCPD server is not the same one
> giving this IP to the client so it remains silent. (this is by the spec
> IMO).
> client backs off for 10 second and start again with DISCOVER. From this
> point everything goes as it should be.
>
> Is there a way to tell dhcpcd to start with DISCOVER instead of attempting
> to (re)use the previous IP?
>
> Any pointers for this? I can add an option for that and stick it in
> if-options.c:parse_option to make it configurable.
>
> Thanks in advance,
> - Kobi
>
>

References:
Can dhcpcd run DISCOVER immeditaly instead of requesting the current IPKobi Cohen-Arazi
Archive administrator: postmaster@marples.name