Re: [PATCH 4/4] netfilter: sysctl support of logger choice.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Leblond wrote:
> Hi,
>
> Patrick McHardy a écrit :
>   
>> Eric Leblond wrote:
>>     
>>> +static int nf_log_proc_dostring(ctl_table *table, int write, struct
>>> file *filp,
>>>       
>>> +    for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) {
>>> +        char *pr_name = 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    = i;
>>>       
>> This ctl_name use seems rather abusive. The names are used
>> as numeric identifiers, we can't just stuff index values in
>> there :)
>>     
>
> 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 (which
you do, but then overwrite it).


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux