public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] Re: Can I switch from DHCP mode to STATIC IP mode during run time to attain IP
Date: Fri, 28 Oct 2005 15:30:00 -0000	[thread overview]
Message-ID: <20051028153146.884A93C371@rivatek.dnsalias.net> (raw)
In-Reply-To: <20051028074103.GB8887@lunn.ch>

In gmane.os.ecos.general, you wrote:

>> Can i change the mode from DHCP/BOOTP to Static mode uring run time.
>> 
>> My requirement is during runtime I want to Configure the
>> interface to a static IP, but at the same time I may need to
>> switch back to DHCP also(vise versa also). Does ecos supports
>> this switching?.

If you're allowed to re-boot when the mode is changed, it's
trivial.

> Looking at the source code is the easiest way to answer this
> question.
>
> Currently there is no clean way to stop the DHCP client. But
> it looks very easy for you to add this functionality. You need
> to extend dhcp_mgt_entry() in dhcp_support.c to allow you to
> break the thread out and exit. Once the thread is dead you can
> then call init_net with a bootp record you create using your
> static IP addresses.

Yup, that should work.  When I did a product that could use
either DHCP or a static address, I started out by doing the
easiest thing: The configuration is only checked at boot-time.
I either start the DHCP client or I configure the network stack
statically.  

This means that when you change the IP address configuration
(either DHCP<->static or change the static address) it doesn't
take effect until the device is restarted. Nobody has ever
complained about the restart requirement.  But, the devices in
question are typically set up once and then just left alone.

-- 
Grant Edwards                   grante             Yow!  Now KEN is having
                                  at               a MENTAL CRISIS beacuse
                               visi.com            his "R.V." PAYMENTS are
                                                   OVER-DUE!!

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

      reply	other threads:[~2005-10-28 15:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-28  6:18 [ECOS] " JUFAIL KAPOOR
2005-10-28  7:41 ` Andrew Lunn
2005-10-28 15:30   ` Grant Edwards [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051028153146.884A93C371@rivatek.dnsalias.net \
    --to=grante@visi.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).