From: "Goran Pantar" <gpantar@xylon.hr>
To: <ecos-discuss@ecos.sourceware.org>
Subject: [ECOS] Runtime network reinit
Date: Mon, 09 May 2005 15:53:00 -0000 [thread overview]
Message-ID: <9D79B9A9194389468A922F618415D0A4020435@abc.xylon.local> (raw)
Hi,
I have initialised the Network stack using fixed IP adresses. I would
now like the possibility to change the IP address at runtime. Is this
possible in eCos?
Parts of my network intialisation procedure:
..
s = socket(AF_INET, SOCK_DGRAM, 0);
..
ioctl(s, SIOCSIFHWADDR, &ifr);
close(s);
..
eth0_bootp_data.bp_op = BOOTREPLY;
eth0_bootp_data.bp_htype = HTYPE_ETHERNET;
eth0_bootp_data.bp_hlen = ETHER_ADDR_LEN;
for(i = 0; i < eth0_bootp_data.bp_hlen; i++)
{
eth0_bootp_data.bp_chaddr[i] = 0xFF;
}
eth0_bootp_data.bp_ciaddr.s_addr = *(in_addr_t *)NetHeader.addr_ip;
eth0_bootp_data.bp_yiaddr.s_addr = *(in_addr_t *)NetHeader.addr_ip;
eth0_bootp_data.bp_siaddr.s_addr = *(in_addr_t
*)NetHeader.addr_server;
eth0_bootp_data.bp_giaddr.s_addr = *(in_addr_t
*)NetHeader.addr_gateway;
..
init_net(eth0_name, ð0_bootp_data);
..
The obove procedure initializes the network sucessfully and all the
services are working. But when I run the same procedure (with changed IP
addresses) init_net fails with a diag print: SIOCIFADDR: File exist.
Thanks,
Goran Pantar
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next reply other threads:[~2005-05-09 10:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-09 15:53 Goran Pantar [this message]
2005-05-11 20:42 ` Andrew Lunn
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=9D79B9A9194389468A922F618415D0A4020435@abc.xylon.local \
--to=gpantar@xylon.hr \
--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).