netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Ludvig <michal@logix.cz>
To: netdev@oss.sgi.com
Subject: [PATCH] ip_gre.c in 2.6.0-test5
Date: Wed, 24 Sep 2003 10:34:58 +0200	[thread overview]
Message-ID: <3F715732.5060306@logix.cz> (raw)

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

Hi all,
this trivial patch fixes possible kernel crash when using GRE tunnels in 
2.6.0-test. The problem was that "dev->init" wasn't set before 
register_netdevice() call and so the initialization function was never 
called. Consequently some fields in the tunnel structure were not 
initialized what finally led to a kernel crash upon receiving the first 
packet over the GRE tunnel.

Michal Ludvig
-- 
* A mouse is a device used to point at the xterm you want to type in.
* Personal homepage - http://www.logix.cz/~mic

[-- Attachment #2: kernel-ip_gre-1.diff --]
[-- Type: text/plain, Size: 642 bytes --]

# Patch for http://bugme.osdl.org/show_bug.cgi?id=1130 
# Applies cleanly to 2.6.0-test5
# Michal Ludvig <mludvig@suse.cz>
--- linux-2.6.0-test5-clean/net/ipv4/ip_gre.c	2003-09-08 21:50:18.000000000 +0200
+++ linux-2.6.0-test5/net/ipv4/ip_gre.c	2003-09-23 16:50:09.000000000 +0200
@@ -271,13 +271,17 @@ static struct ip_tunnel * ipgre_tunnel_l
 	}
 
 	dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup);
+	if (!dev)
+	  return NULL;
+
+	dev->init = ipgre_tunnel_init;
+
 	if (register_netdevice(dev) < 0) {
 		kfree(dev);
 		goto failed;
 	}
 
 	nt = dev->priv;
-	dev->init = ipgre_tunnel_init;
 	nt->parms = *parms;
 
 	dev_hold(dev);

             reply	other threads:[~2003-09-24  8:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-24  8:34 Michal Ludvig [this message]
2003-09-25 10:56 ` [PATCH] ip_gre.c in 2.6.0-test5 David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F715732.5060306@logix.cz \
    --to=michal@logix.cz \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).