From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: [PATCH 4/4] netfilter: sysctl support of logger choice. Date: Thu, 19 Feb 2009 22:02:47 +0100 Message-ID: <499DC8F7.8080206@trash.net> References: <49980BA7.2040108@inl.fr> <1234701437-2754-4-git-send-email-eric@inl.fr> <499C2F92.3080105@trash.net> <499DC817.7010305@inl.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: netfilter-devel@vger.kernel.org To: Eric Leblond Return-path: Received: from stinky.trash.net ([213.144.137.162]:62773 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755252AbZBSVCx (ORCPT ); Thu, 19 Feb 2009 16:02:53 -0500 In-Reply-To: <499DC817.7010305@inl.fr> Sender: netfilter-devel-owner@vger.kernel.org List-ID: Eric Leblond wrote: > Hi, > > Patrick McHardy a =E9crit : > =20 >> Eric Leblond wrote: >> =20 >>> +static int nf_log_proc_dostring(ctl_table *table, int write, struc= t >>> file *filp, >>> =20 >>> + for (i =3D NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) { >>> + char *pr_name =3D kmalloc(3, GFP_KERNEL); >>> + /* FIXME free at deinit but there is currently no deinit *= / >>> + snprintf(pr_name, 3, "%d", i); >>> + nf_log_sysctl_table[i].ctl_name =3D i; >>> =20 >> This ctl_name use seems rather abusive. The names are used >> as numeric identifiers, we can't just stuff index values in >> there :) >> =20 > > Your remark is not clear for me. I store here a integer which is the > protocol number. I see it as a real numeric identifier. > > Which change are you suggesting ? Its an identifier for the sysctl syscall, its not meant to be used with private identifiers. And any new sysctl should use CTL_UNNUMBERED (whic= h you do, but then overwrite it). -- To unsubscribe from this list: send the line "unsubscribe netfilter-dev= el" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html