Re: Invalid size of target

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

 



On Monday 2008-07-14 22:36, Kevin Sookocheff wrote:

>OK.  That makes sense for what I'm seeing.
>
>What I have is the following struct:
>
>struct ipt_CSUM_info {
>    u_int32_t       address;
>    u_int8_t        addressCount;
>    u_int16_t       port;
>    u_int8_t        portCount;
>    u_int8_t        interval;
>    u_int8_t        maxFailures;
>};

There's padding involved between the 8/16.

>and I register the following target in lib*.c:
>
>static struct iptables_target CSUM = {
>    .next       = NULL,

This line not needed.

>    .name       = "CSUM",
>    .version    = NETFILTER_VERSION,

NETFILTER_VERSION?

>    .size       = IPT_ALIGN(sizeof(struct ipt_CSUM_info)),
>    .userspacesize  = IPT_ALIGN(sizeof(struct ipt_CSUM_info)),
>    .help       = &help,
>    .parse      = &parse,
>    .final_check    = &final_check,
>    .print      = &print,
>    .save       = &save,
>    .extra_opts = opts
>};

Seems like a really old module.

>void _init(void)
>{
>    register_target(&CSUM);
>}
>
>Then I try and register the target in the kernel C file which is where
>it seems to fail:
>
>static struct ipt_target ipt_CSUM = {
>    .name       = "CSUM",
>    .target     = ipt_csum_target,
>    .checkentry = ipt_csum_checkentry,
>};

Well well, where is .targetsize? No wonder it prints 0 != 12 ;-)

>static int __init init(void)
>{
>    ipt_char_major = register_chrdev(0,"ipt_CSUM_char",&char_fops);
>    init_timer(&csum_timer);
>    csum_timer.function = timer_callback;
>    init_waitqueue_head(&inqMSG);
>    printk("register target\n");
>    return ipt_register_target(&ipt_CSUM);
>}
>
--
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