public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Tarmo Kuuse <tarmo.kuuse@mail.ee>
To: ecos-discuss@sources.redhat.com
Subject: [ECOS]  Re: How to deconfigure an interface?
Date: Tue, 01 Sep 2009 08:59:00 -0000	[thread overview]
Message-ID: <h7inou$i9b$1@ger.gmane.org> (raw)
In-Reply-To: <4A9C0111.70300@gmail.com>

Hi Stanislav,

Stanislav Meduna wrote:
> I'd like to be able to change an IP address of an interface
> without reboot. 

Same here.

> The same happens if I try to set the address using SIOCSIFADDR.
> Is this the intended behaviour? Shouldn't the SIFADDR
> change the address and AIFADDR add a new one?

I think it's intended behaviour.

> Is there a way to bring the IP stack back to the clean
> state, or does one needs to deconfigure the interface
> step-by step by removing addresses already configured
> using SIOCDIFADDR (which works)?

There could be a better way, but I just do SIOCGIFADDR to read the 
current addresses from an interface and delete them with SIOCDIFADDR. As 
input, the "struct ifreq" needs the interface's textual name (e.g. 
"eth0"). Works fine.

Another task which needs doing is clearing the routes table. There 
exists a function "cyg_route_reinit()" which simply flushes all routes. 
Unfortunately it also deletes routes for the local loopback and all 
other interfaces you may have. I haven't yet figured out how to delete 
the routes only for a given interface.

Have a look at function do_dhcp_down_net() in dhcp_prot.c for an example.

--
Kind regards,
Tarmo Kuuse


-- 
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:[~2009-09-01  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 16:58 [ECOS] " Stanislav Meduna
2009-09-01  8:59 ` Tarmo Kuuse [this message]
2009-09-01  9:59   ` [ECOS] " Stanislav Meduna
2009-09-01 13:59     ` Tarmo Kuuse

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='h7inou$i9b$1@ger.gmane.org' \
    --to=tarmo.kuuse@mail.ee \
    --cc=ecos-discuss@sources.redhat.com \
    /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).