9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] ndb/cs problem?
@ 2002-06-17 12:19 presotto
  0 siblings, 0 replies; 3+ messages in thread
From: presotto @ 2002-06-17 12:19 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

Its supposed to be the default.  It doesn't work because I left the
return out of the if in the loop when I rewrote it to go with
the new readipifc interface.  The code should look like:

void
readipinterfaces(void)
{
	Ipifc *nifc;
	Iplifc *lifc;

	ipifcs = readipifc(mntpt, ipifcs, -1);
	for(nifc = ipifcs; nifc; nifc = nifc->next)
		for(lifc = nifc->lifc; lifc; lifc = lifc->next)
			if(ipcmp(lifc->ip, IPnoaddr) != 0){
				ipmove(ipa, lifc->ip);
				sprint(ipaddr, "%I", ipa);
				if(debug)
					syslog(0, "dns", "ipaddr is %s\n", ipaddr);
				return;
			}
	ipmove(ipa, IPnoaddr);
}

Thanks, I'm an idiot.

[-- Attachment #2: Type: message/rfc822, Size: 1695 bytes --]

From: Fco.J.Ballesteros <nemo@plan9.escet.urjc.es>
To: 9fans@cse.psu.edu
Subject: [9fans] ndb/cs problem?
Date: Mon, 17 Jun 2002 10:04:56 +0200
Message-ID: <2aaf2727225e09ab22df56d9a86dd340@plan9.escet.urjc.es>


Hi,

Readipinterfaces() in ndb/cs.c sets ipa to IPnoaddr (even though it's
able to locate a real ip address in the loops before).

The problem with this is that when you start cs on a machine without
an ethernet interface and a loopback ip interface, cs no longer
sets the system name.

I just commented out the "ipmove(ipa, IPnoaddr)" and it works like a
charm.  Is there anything I'm missing, i.e.  any reason for that line
of code to be there?

thanks



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] ndb/cs problem?
@ 2002-06-18 17:09 FJ Ballesteros
  0 siblings, 0 replies; 3+ messages in thread
From: FJ Ballesteros @ 2002-06-18 17:09 UTC (permalink / raw)
  To: 9fans

No. I'm the idiot. After you pointed it out, it seems obvious that
the for would return any address found and fall back to the IPnoaddr
when none is found. I'm fixing my (un)fixed ndb/cs with your code.

thanks a lot.


> Its supposed to be the default.  It doesn't work because I left the
> return out of the if in the loop when I rewrote it to go with
> the new readipifc interface.  The code should look like:
>
> void
> readipinterfaces(void)
> {
>       Ipifc *nifc;
>       Iplifc *lifc;
>
>       ipifcs = readipifc(mntpt, ipifcs, -1);
>       for(nifc = ipifcs; nifc; nifc = nifc->next)
>               for(lifc = nifc->lifc; lifc; lifc = lifc->next)
>                       if(ipcmp(lifc->ip, IPnoaddr) != 0){
>                               ipmove(ipa, lifc->ip);
>                               sprint(ipaddr, "%I", ipa);
>                               if(debug)
>                                       syslog(0, "dns", "ipaddr is %s\n", ipaddr);
>                               return;
>                       }
>       ipmove(ipa, IPnoaddr);
> }
>
> Thanks, I'm an idiot.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] ndb/cs problem?
@ 2002-06-17  8:04 Fco.J.Ballesteros
  0 siblings, 0 replies; 3+ messages in thread
From: Fco.J.Ballesteros @ 2002-06-17  8:04 UTC (permalink / raw)
  To: 9fans


Hi,

Readipinterfaces() in ndb/cs.c sets ipa to IPnoaddr (even though it's
able to locate a real ip address in the loops before).

The problem with this is that when you start cs on a machine without
an ethernet interface and a loopback ip interface, cs no longer
sets the system name.

I just commented out the "ipmove(ipa, IPnoaddr)" and it works like a
charm.  Is there anything I'm missing, i.e.  any reason for that line
of code to be there?

thanks





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-06-18 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-17 12:19 [9fans] ndb/cs problem? presotto
  -- strict thread matches above, loose matches on Subject: below --
2002-06-18 17:09 FJ Ballesteros
2002-06-17  8:04 Fco.J.Ballesteros

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 NNTP newsgroup(s).