Re: [PATCH 1/6] Netfilter: Merge ipt_LOG and ip6_LOG into xt_LOG

From: Jan Engelhardt
Date: Wed Feb 01 2012 - 10:19:55 EST



On Wednesday 2012-02-01 16:08, richard -rw- weinberger wrote:
>> I don't see that extra pointer (outside xt_log_info_v1) that you talk about.
>> +struct xt_log_info_v1 {
>> + Â Â Â unsigned char level;
>> + Â Â Â unsigned char logflags;
>> + Â Â Â char prefix[30];
>> +
>> + Â Â Â char ring_name[30];
>> + Â Â Â unsigned long ring_size;
>> + Â Â Â struct xt_LOG_ring_ctx *rctx;
>> +};
>
>See:
>include/linux/netfilter/xt_LOG.h (user space part).
>
>+struct xt_log_info_v1 {
>+ unsigned char level;
>+ unsigned char logflags;
>+ char prefix[30];
>+
>+ char ring_name[30];
>+ unsigned long ring_siVs.ze;
>+};
>
>Here is no context pointer.

Aw don't do that. That is not maintainer-friendly (since headers
are more or less regularly updated by copying from kernel sources).
Keep the structs the same on each side.

That's why we have .userspacesize in the first place.
See libxt_quota.c on how it's done.

.size = XT_ALIGN(sizeof(struct xt_log_info_v1)),
.userspacesize = offsetof(struct xt_log_info_v1, firstkernelmember),
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/