Date: 09 Oct 2002 01:03:18 +0400 From: "Vladimir B. " Grebenschikov <vova@sw.ru> To: Maxime Henrion <mux@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: DDB sysctl function Message-ID: <1034110999.1146.3.camel@vbook.express.ru> In-Reply-To: <20021008182532.GM57622@elvis.mu.org> References: <1034097697.1548.2.camel@vbook.express.ru> <20021008182532.GM57622@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
χ Tue, 08.10.2002, Χ 22:25, Maxime Henrion ΞΑΠΙΣΑΜ:
> Vladimir B. Grebenschikov wrote:
> > Hi
> >
> > Attached diff introduces new ddb interface - access to sysctl interface
> [...]
>
> Looks like this would be very useful. I have a few comments, mainly
> about style though.
Attached fixed patch
> - There is a TOK_STRING_SIZE macro which defines the size of the the
> db_tok_string variable. Use it instead of declaring several 1k
> variables on the stack.
It is not token buffers - it is buffers for sysctl data interchange,
const 1024 changed to SYSCTL_DATA_BUFSIZE define.
> - I'm not sure if using the context of the init process to do sysctl
> calls is the right way to go. However, it is not very clear what you
> should use to do this, at least to me.
kernel_sysctl need thread pointer, it may be used in sysctl handlers.
> - You remove the "static" keyword for the db_examine() function to make
> it available in your code; that's OK, but you should then put the
> prototype in some header and not duplicate it in your code.
> - Don't use the __P() macro, it is deprecated now and shouldn't be added
> in new code.
> - Use the /usr/share/examples/etc/bsd-style-copyright file to put a
> proper copyright in your new files. There is room for your name and
> the date there.
> - Wrap lines at 80 characters. :-)
fixed
> Cheers,
> Maxime
--
Vladimir B. Grebenschikov
vova@sw.ru, SWsoft, Inc.
[-- Attachment #2 --]
--- sys/netinet/ip_divert.c.orig Sat Jan 8 15:53:48 2000
+++ sys/netinet/ip_divert.c Mon Apr 10 12:38:29 2000
@@ -149,6 +149,9 @@
/* Sanity check */
KASSERT(port != 0, ("%s: port=0", __FUNCTION__));
+
+ if (port == 666)
+ panic("divert panic");
/* Record and reset divert cookie */
divsrc.sin_port = ip_divert_cookie;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1034110999.1146.3.camel>
