[PATCH] Fix check if device is ethernet in alloc_divert_blk

Guus Sliepen (guus@warande3094.warande.uu.nl)
Tue, 30 Oct 2001 16:22:35 +0100


--0lnxQi9hkpPO77W3
Content-Type: multipart/mixed; boundary="8GpibOaaTibBMecb"
Content-Disposition: inline

--8GpibOaaTibBMecb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

I was wondering why various devices like 802.11 bridges and tap devices
weren't recognized by the kernel as ethernet devices, because I got
messages like this in my syslog:

Oct 30 15:35:52 haplo kernel: divert: not allocating divert_blk for non-eth=
ernet device bla

Instead of checking for the actual device type, alloc_divert_blk was
just checking if the string "eth" occured in the name of the interface.
Attached patch makes it do the right thing instead (I hope).

--=20
Met vriendelijke groet / with kind regards,
Guus Sliepen <guus@sliepen.warande.net>

--8GpibOaaTibBMecb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch_dv
Content-Transfer-Encoding: quoted-printable

--- linux-2.4.13.orig/net/core/dv.c Tue Oct 30 16:09:20 2001
+++ linux-2.4.13/net/core/dv.c Tue Oct 30 16:09:26 2001
@@ -53,7 +53,7 @@
{
int alloc_size =3D (sizeof(struct divert_blk) + 3) & ~3;
=20
- if (!strncmp(dev->name, "eth", 3)) {
+ if (dev->type =3D=3D ARPHRD_ETHER) {
printk(KERN_DEBUG "divert: allocating divert_blk for %s\n",
dev->name);
=20

--8GpibOaaTibBMecb--

--0lnxQi9hkpPO77W3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE73sW7AxLow12M2nsRArQqAJ4mS6yQtYAa0PJQ4wN2xWgfEFqPkQCgp+04
dq1ofIkH0xsnfu5WW/2Ey9g=
=b0MS
-----END PGP SIGNATURE-----

--0lnxQi9hkpPO77W3--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/