From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3D0F6958.4C8E0579@gsyc.escet.urjc.es> From: FJ Ballesteros MIME-Version: 1.0 To: 9fans@cse.psu.edu Subject: Re: [9fans] ndb/cs problem? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 18 Jun 2002 19:09:45 +0200 Topicbox-Message-UUID: b3044d5a-eaca-11e9-9e20-41e7f4b1d025 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.