* [PATCH] fix the number of bytes cleaned by clean_nat() in net/ipv4/netfilter/nf_nat_core.c
@ 2007-11-06 20:58 Roel Kluin
2007-11-06 23:58 ` Patrick McHardy
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2007-11-06 20:58 UTC (permalink / raw)
To: netfilter-devel
Zero out 'sizeof(*nat)' rather than 'sizeof(nat)' bytes of the struct
nf_conn_nat pointer 'nat'
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index 56e93f6..70e7997 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -681,7 +681,7 @@ static int clean_nat(struct nf_conn *i, void *data)
if (!nat)
return 0;
- memset(nat, 0, sizeof(nat));
+ memset(nat, 0, sizeof(*nat));
i->status &= ~(IPS_NAT_MASK | IPS_NAT_DONE_MASK | IPS_SEQ_ADJUST);
return 0;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fix the number of bytes cleaned by clean_nat() in net/ipv4/netfilter/nf_nat_core.c
2007-11-06 20:58 [PATCH] fix the number of bytes cleaned by clean_nat() in net/ipv4/netfilter/nf_nat_core.c Roel Kluin
@ 2007-11-06 23:58 ` Patrick McHardy
0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2007-11-06 23:58 UTC (permalink / raw)
To: Roel Kluin; +Cc: netfilter-devel
Roel Kluin wrote:
> Zero out 'sizeof(*nat)' rather than 'sizeof(nat)' bytes of the struct
> nf_conn_nat pointer 'nat'
>
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> ---
> diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
> index 56e93f6..70e7997 100644
> --- a/net/ipv4/netfilter/nf_nat_core.c
> +++ b/net/ipv4/netfilter/nf_nat_core.c
> @@ -681,7 +681,7 @@ static int clean_nat(struct nf_conn *i, void *data)
>
> if (!nat)
> return 0;
> - memset(nat, 0, sizeof(nat));
> + memset(nat, 0, sizeof(*nat));
> i->status &= ~(IPS_NAT_MASK | IPS_NAT_DONE_MASK | IPS_SEQ_ADJUST);
> return 0;
> }
I already have the same patch queued from Li Zefan. Good catch anyway :)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-06 23:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-06 20:58 [PATCH] fix the number of bytes cleaned by clean_nat() in net/ipv4/netfilter/nf_nat_core.c Roel Kluin
2007-11-06 23:58 ` Patrick McHardy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).