Patchwork gre: minor cleanups in netlink interface

login
register
mail settings
Submitter Herbert Xu
Date Oct. 11, 2008, 12:43 p.m.
Message ID <20081011124348.GA6845@gondor.apana.org.au>
Download mbox | patch
Permalink /patch/4005/
State Accepted
Delegated to: David Miller
Headers show

Comments

Herbert Xu - Oct. 11, 2008, 12:43 p.m.
On Sat, Oct 11, 2008 at 06:39:35PM +0800, Herbert Xu wrote:
> 
> I think this should be done in iproute.  That way the user (or
> rather the user-space programmer) gets to choose the behaviour.
> This is also how the existing interface works too.

But there is a stupid bug in my code that causes garbage to
show up in the configuration.

gre: Initialise rtnl_link tunnel parameters properly

Brown paper bag error of calling memset with sizeof(p) instead
of sizeof(*p).

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
David Miller - Oct. 11, 2008, 7:20 p.m.
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Sat, 11 Oct 2008 20:43:48 +0800

> gre: Initialise rtnl_link tunnel parameters properly
> 
> Brown paper bag error of calling memset with sizeof(p) instead
> of sizeof(*p).
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied to net-2.6, thanks Herbert.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 0d5e35b..482abda 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1345,7 +1345,7 @@  out:
 static void ipgre_netlink_parms(struct nlattr *data[],
 				struct ip_tunnel_parm *parms)
 {
-	memset(parms, 0, sizeof(parms));
+	memset(parms, 0, sizeof(*parms));
 
 	parms->iph.protocol = IPPROTO_GRE;