Re: [design] near-fatal unregister_netdevice errors (freeswan 2.04)

Sam Sgro <[email protected]> Tue, 27 Jan 2004 13:01:23 -0500
Newsgroups gmane.network.freeswan.user,gmane.network.freeswan.devel
Message-ID <[email protected]>
--Boundary-00=_zdqFAqJDYqriGQf
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Description: clearsigned data
Content-Disposition: inline

-----BEGIN PGP SIGNED MESSAGE-----

> [root@gwwa ipsec]# patch < /tmp/freepatch.txt
> (Stripping trailing CRs from patch.)
> patching file ipsec_tunnel.c
> Hunk #1 FAILED at 1097.
> Hunk #2 FAILED at 1167.
> Hunk #3 FAILED at 1235.
> Hunk #4 FAILED at 1245.
> Hunk #5 FAILED at 1255.
> 5 out of 5 hunks FAILED -- saving rejects to file ipsec_tunnel.c.rej

Maybe it's a whitespace problem; try this regenerated patch. I'm also=20
attaching it to this mail; see if either helps.

- --=20
Sam Sgro
[email protected]



- --- ipsec_tunnel.c	2004-01-27 12:54:54.000000000 -0500
+++ ipsec_tunnel.c.patched	2004-01-27 12:57:10.000000000 -0500
@@ -1097,6 +1097,7 @@
 		    prv->dev ? prv->dev->name : "NULL",
 		    dev->name);
=20
+	ipsec_dev_put(prv->dev);
 	prv->dev =3D NULL;
 	prv->hard_start_xmit =3D NULL;
 	prv->get_stats =3D NULL;
@@ -1166,8 +1167,8 @@
 		    "klips_debug:ipsec_tunnel_clear: .\n");
=20
 	for(i =3D 0; i < IPSEC_NUM_IF; i++) {
- -		sprintf(name, IPSEC_DEV_FORMAT, i);
- -		if((ipsecdev =3D ipsec_dev_get(name)) !=3D NULL) {
+		ipsecdev =3D ipsecdevices[i];
+		if(ipsecdev !=3D NULL) {
 			if((prv =3D (struct ipsecpriv *)(ipsecdev->priv))) {
 				prvdev =3D (struct device *)(prv->dev);
 				if(prvdev) {
@@ -1234,6 +1235,7 @@
 				    "klips_debug:ipsec_tunnel_ioctl: "
 				    "physical device %s requested is null\n",
 				    cf->cf_name);
+			ipsec_dev_put(them);
 			return -ENXIO;
 		}
=20=09=09
@@ -1243,6 +1245,7 @@
 				    "klips_debug:ipsec_tunnel_ioctl: "
 				    "physical device %s requested is not up.\n",
 				    cf->cf_name);
+			ipsec_dev_put(them);
 			return -ENXIO;
 		}
 #endif
@@ -1252,6 +1255,7 @@
 				    "klips_debug:ipsec_tunnel_ioctl: "
 				    "virtual device is already connected to %s.\n",
 				    prv->dev->name ? prv->dev->name : "NULL");
+			ipsec_dev_put(them);
 			return -EBUSY;
 		}
 		return ipsec_tunnel_attach(dev, them);

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iQCVAwUBQBanc0OSC4btEQUtAQEYVAP/Y4KBShpuZhH0MLu6ihrNpRepfSuKFda7
KigxU5tri8DJFopOlg4+zPH+4rPhAStlL+FgFt10HH1mBbBpfDw0uJAWA0w6ZOXU
3hQSCcNbRRY5Wq5IsP15y3VYmtGN9eUu5r5S1x4eLUsaIh1QIID/sWfftJBiNNOx
k4LVrlZULHU=3D
=3D9Ks2
-----END PGP SIGNATURE-----

--Boundary-00=_zdqFAqJDYqriGQf
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="ipsec_tunnel_patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="ipsec_tunnel_patch"

--- ipsec_tunnel.c	2004-01-27 12:54:54.000000000 -0500
+++ ipsec_tunnel.c.patched	2004-01-27 12:57:10.000000000 -0500
@@ -1097,6 +1097,7 @@
 		    prv->dev ? prv->dev->name : "NULL",
 		    dev->name);
 
+	ipsec_dev_put(prv->dev);
 	prv->dev = NULL;
 	prv->hard_start_xmit = NULL;
 	prv->get_stats = NULL;
@@ -1166,8 +1167,8 @@
 		    "klips_debug:ipsec_tunnel_clear: .\n");
 
 	for(i = 0; i < IPSEC_NUM_IF; i++) {
-		sprintf(name, IPSEC_DEV_FORMAT, i);
-		if((ipsecdev = ipsec_dev_get(name)) != NULL) {
+		ipsecdev = ipsecdevices[i];
+		if(ipsecdev != NULL) {
 			if((prv = (struct ipsecpriv *)(ipsecdev->priv))) {
 				prvdev = (struct device *)(prv->dev);
 				if(prvdev) {
@@ -1234,6 +1235,7 @@
 				    "klips_debug:ipsec_tunnel_ioctl: "
 				    "physical device %s requested is null\n",
 				    cf->cf_name);
+			ipsec_dev_put(them);
 			return -ENXIO;
 		}
 		
@@ -1243,6 +1245,7 @@
 				    "klips_debug:ipsec_tunnel_ioctl: "
 				    "physical device %s requested is not up.\n",
 				    cf->cf_name);
+			ipsec_dev_put(them);
 			return -ENXIO;
 		}
 #endif
@@ -1252,6 +1255,7 @@
 				    "klips_debug:ipsec_tunnel_ioctl: "
 				    "virtual device is already connected to %s.\n",
 				    prv->dev->name ? prv->dev->name : "NULL");
+			ipsec_dev_put(them);
 			return -EBUSY;
 		}
 		return ipsec_tunnel_attach(dev, them);

--Boundary-00=_zdqFAqJDYqriGQf
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0

_______________________________________________
FreeS/WAN Users mailing list
[email protected]
https://mj2.freeswan.org/cgi-bin/mj_wwwusr

--Boundary-00=_zdqFAqJDYqriGQf--