From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30957 invoked by alias); 1 Sep 2009 08:59:40 -0000 Received: (qmail 30946 invoked by uid 22791); 1 Sep 2009 08:59:40 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Sep 2009 08:59:36 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1MiPDB-00056i-AX for ecos-discuss@sources.redhat.com; Tue, 01 Sep 2009 10:59:33 +0200 Received: from pro1.proekspert.ee ([212.47.207.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Sep 2009 10:59:33 +0200 Received: from tarmo.kuuse by pro1.proekspert.ee with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Sep 2009 10:59:33 +0200 To: ecos-discuss@sources.redhat.com From: Tarmo Kuuse Date: Tue, 01 Sep 2009 08:59:00 -0000 Message-ID: References: <4A9C0111.70300@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) In-Reply-To: <4A9C0111.70300@gmail.com> X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: How to deconfigure an interface? X-SW-Source: 2009-09/txt/msg00004.txt.bz2 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