From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gary Thomas To: Grant Edwards Cc: ecos-discuss@sourceware.cygnus.com, Nick Barnes Subject: Re: [ECOS] Notes on static configuration of an eCos network inte Date: Mon, 17 Jul 2000 09:03:00 -0000 Message-id: References: <20000717155244.A29492@visi.com> X-SW-Source: 2000-07/msg00155.html On 17-Jul-2000 Grant Edwards wrote: > >> Notes on static configuration of an eCos network interface > >> The siaddr and giaddr fields of a BOOTP message are irrelevant to >> configuring a network interface: they are used for talking to the >> BOOTP server (e.g. for TFTPing a kernel). > > Aaargh. That's why my routing table isn't getting initialized. > >> init_net() should initialize the interface as follows: >> >> SIOCSIFADDR, yiaddr >> SIOCSIFNETMASK, TAG_SUBNET_MASK >> SIOCSIFBRDADDR, TAG_IP_BROADCAST >> SIOCADDRT, 0, 0, TAG_GATEWAY > > Right now, I'm building a fake bootp record and passing it to > init_net(). This seems to be way more work than it's worth > (especially since it's not right), so I'm going to throw out > all of the fake bootp stuff and just duplicate the code in > net_init(), passing the right IP addresses in the ioctl() calls. > > It will end up being a lot smaller and simpler that way. Is > there any reason I shouldn't do that? The reason that init_net() is based on BOOTP now is for flexibility. By having the numbers hard coded [somehow] in the routine, you loose all of that. I always vote for flexible; I've been bitten by "fixed" implementations too many times in the past. As for your pain: * why do you think the current way of creating BOOTP data is more work than coding the values directly? * how is what you are using different than the code in "init_all_network..." when non-BOOTP mode is selected? * if things aren't working, ask for help. Nick [Barnes] seems to be getting quite a lot [of feedback at least] by doing so.