From: presotto@plan9.bell-labs.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] ndb/cs
Date: Thu, 17 Aug 2000 18:05:14 -0400 [thread overview]
Message-ID: <200008172205.SAA25150@cse.psu.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 309 bytes --]
cool, I'ld never noticed that netstat didn't return port names for
il. Guess I use the -n option too often.
As far as I can see, I have 2 errors here. One is in csgetval which
should be asking for '!port=566 il=*' which would have kept me from
noticing the other bug, the one that Lucio De Re fixed.
[-- Attachment #2: Type: message/rfc822, Size: 2991 bytes --]
[-- Attachment #2.1.1: Type: text/plain, Size: 626 bytes --]
On Thu, Aug 17, 2000 at 06:55:20PM +0200, Lucio De Re wrote:
>
> Basically, a csgetval(2) called as follows:
> csgetval ("net", "port", "566", "il", buf);
> returns a failure because, apparently, the request to /net/cs stops at
> the first entry (port=566 tcp=guard). The actual value returned by
> csetval(2) seems to contain _only_ the above entry.
>
I decided to take the plunge.
In /sys/src/cmd/ndb, I modified cs.c by adding a "count" value in
genquery() instead of terminating after the first match. I don't
know if the same juggling in necessary elsewhere. It solved the
netstat(1) problem.
++L
[-- Attachment #2.1.2: cs.c.diff --]
[-- Type: text/plain, Size: 510 bytes --]
diff -n /mnt/wrap/sys/src/cmd/ndb/cs.c /sys/src/cmd/ndb/cs.c
/mnt/wrap/sys/src/cmd/ndb/cs.c:1704 a /sys/src/cmd/ndb/cs.c:1705
> int count = 0;
/mnt/wrap/sys/src/cmd/ndb/cs.c:1733,1734 c /sys/src/cmd/ndb/cs.c:1734
< ndbfree(t);
< return 0;
---
> count++;
/mnt/wrap/sys/src/cmd/ndb/cs.c:1747,1748 c /sys/src/cmd/ndb/cs.c:1747
< ndbfree(t);
< return 0;
---
> count++;
/mnt/wrap/sys/src/cmd/ndb/cs.c:1754 c /sys/src/cmd/ndb/cs.c:1753,1754
<
---
> if (count)
> return 0;
next reply other threads:[~2000-08-17 22:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-08-17 22:05 presotto [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-08-17 16:55 Lucio De Re
2000-08-17 18:52 ` Lucio De Re
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=200008172205.SAA25150@cse.psu.edu \
--to=presotto@plan9.bell-labs.com \
--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).