9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: FJ Ballesteros <nemo@gsyc.escet.urjc.es>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] ndb/cs problem?
Date: Tue, 18 Jun 2002 19:09:45 +0200	[thread overview]
Message-ID: <3D0F6958.4C8E0579@gsyc.escet.urjc.es> (raw)

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.


             reply	other threads:[~2002-06-18 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-18 17:09 FJ Ballesteros [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-17 12:19 presotto
2002-06-17  8:04 Fco.J.Ballesteros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D0F6958.4C8E0579@gsyc.escet.urjc.es \
    --to=nemo@gsyc.escet.urjc.es \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).