Re: [PATCH iptables] extensions: libipt_DNAT: use size of nf_nat_range2 for rev2

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

 



On 03-05-18 21:40, Florian Westphal wrote:
> DNAT tests fail on nf-next.git, kernel complains about target size
> mismatch (40 vs 48), this fixes this for me.
>
> Fixes: 36976c4b5406 ("extensions: libipt_DNAT: support shifted portmap ranges")
> Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
> ---
>  extensions/libip6t_DNAT.c | 4 ++--
>  extensions/libipt_DNAT.c  | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/extensions/libip6t_DNAT.c b/extensions/libip6t_DNAT.c
> index 2a7574b02444..89c5ceb15325 100644
> --- a/extensions/libip6t_DNAT.c
> +++ b/extensions/libip6t_DNAT.c
> @@ -393,8 +393,8 @@ static struct xtables_target dnat_tg_reg[] = {
>  		.version	= XTABLES_VERSION,
>  		.family		= NFPROTO_IPV6,
>  		.revision	= 2,
> -		.size		= XT_ALIGN(sizeof(struct nf_nat_range)),
> -		.userspacesize	= XT_ALIGN(sizeof(struct nf_nat_range)),
> +		.size		= XT_ALIGN(sizeof(struct nf_nat_range2)),
> +		.userspacesize	= XT_ALIGN(sizeof(struct nf_nat_range2)),
>  		.help		= DNAT_help_v2,
>  		.print		= DNAT_print_v2,
>  		.save		= DNAT_save_v2,
> diff --git a/extensions/libipt_DNAT.c b/extensions/libipt_DNAT.c
> index b89d3ca5f0d4..4907a2e83d06 100644
> --- a/extensions/libipt_DNAT.c
> +++ b/extensions/libipt_DNAT.c
> @@ -537,8 +537,8 @@ static struct xtables_target dnat_tg_reg[] = {
>  		.version	= XTABLES_VERSION,
>  		.family		= NFPROTO_IPV4,
>  		.revision	= 2,
> -		.size		= XT_ALIGN(sizeof(struct nf_nat_range)),
> -		.userspacesize	= XT_ALIGN(sizeof(struct nf_nat_range)),
> +		.size		= XT_ALIGN(sizeof(struct nf_nat_range2)),
> +		.userspacesize	= XT_ALIGN(sizeof(struct nf_nat_range2)),
>  		.help		= DNAT_help_v2,
>  		.print		= DNAT_print_v2,
>  		.save		= DNAT_save_v2,
Hi Florian,

I'm going to verify, but that looks like a logical fix indeed.

Thierry
--
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