[klibc] problems with ipconfig command (no static config possible)

Olaf Hering olh at suse.de
Thu Aug 26 16:30:53 PDT 2004


 On Wed, Aug 25, H. Peter Anvin wrote:

> Dirk von Suchodoletz wrote:
> >
> >I tried the 167 of the klibc code (especially ipconfig and nfsmount) 
> >yesterday. Everything worked fine, if I added the interface to the
> >ip= line from either PXE or etherboot. Unfortunately etherboot puts a 
> >hostname into this line and PXE not. If I simply pass the line without 
> >addition to ipconfig then the loopback device is configured (That seems to 
> >me of no much sense :-( ) ...
> >
> >Any ideas how this could be solved?
> >
> 
> OK, there is a heuristic which is intended to keep the loopback device 
> from being the device selected to configure; clearly it's not working. 
> I will look at this as soon as I get a chance.

I get if(0&&0) continue; for loopback and if(1&&2)continue; for eth0 in
ipconfig.
ipconfig should continue, ic_open_devs() should do the actual work.

Better skip the entry if the interface is loopback or if the interface
cant do broadcast and point to point.

--- /dev/shm/klibc-0.170/ipconfig/main.c	2004-08-19 18:19:42.000000000 +0200
+++ ./ipconfig/main.c	2004-08-26 15:28:51.572661763 +0200
@@ -610,8 +610,8 @@ static int add_all_devices(struct netdev
 		flags = strtoul(p, NULL, 0);
 		/* Heuristic for if this is a reasonable boot interface.  This is the same
 		   logic the in-kernel ipconfig uses... */
-		if ( !(flags & IFF_LOOPBACK) &&
-		     (flags & (IFF_BROADCAST|IFF_POINTOPOINT)) )
+		if ( (flags & IFF_LOOPBACK) ||
+		    !(flags & (IFF_BROADCAST|IFF_POINTOPOINT)) )
 			continue;
 		if ((dev = add_device(de->d_name)) == NULL)
 			continue;

-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG



More information about the klibc mailing list