diff mbox

gre: minor cleanups in netlink interface

Message ID 20081011124348.GA6845@gondor.apana.org.au
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Herbert Xu Oct. 11, 2008, 12:43 p.m. UTC
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,

Comments

David Miller Oct. 11, 2008, 7:20 p.m. UTC | #1
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
diff mbox

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;