From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugo 'NOx' Tyson To: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] Notes on static configuration of an eCos network interface Date: Mon, 17 Jul 2000 09:45:00 -0000 Message-id: References: <25482.963837944@raven.ravenbrook.com> <20000717155244.A29492@visi.com> X-SW-Source: 2000-07/msg00159.html Grant Edwards writes: > > 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? None whatsoever! Using the ioctl() calls will always be right. And that way you know what you'll be getting, and how it'll be set up, rather than depending on what we happen to have put in as helpful examples and for the convenience of our test programs. - Huge