Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jan 2002 23:51:40 -0500 (EST)
From:      Andrew Atrens <andrew_atrens@yahoo.ca>
To:        marcel@freebsd.org, stable@freebsd.org
Subject:   small fix for sys/compat/linux/linux_ioctl.c
Message-ID:  <20020107045140.16097.qmail@web11305.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
--0-864342549-1010379100=:13168
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

All,

A recent commit has broken Clearcase4 client support on -stable. This
small change appears to fix it.  I've been using a kernel built with
this
fix for the last 30+ days without incident. Unfortunately I have only
one box here to test on.


Here's the commit info -

|
| Revision 1.55.2.7, Thu Dec 6 09:04:24 2001 UTC (4 weeks, 3 days ago)
by marcel
| Branch: RELENG_4
| Changes since 1.55.2.6: +9 -3 lines
|
| MFC: rev 1.77
|


And here's my patch -


--- linux_ioctl.c.orig  Sun Jan  6 21:40:10 2002
+++ linux_ioctl.c       Sun Jan  6 21:40:45 2002
@@ -1381,7 +1381,7 @@
        struct ifnet *ifp;
        int len, unit;
        char *ep;
-       int is_eth, index;
+       int is_eth;

        for (len = 0; len < LINUX_IFNAMSIZ; ++len)
                if (!isalpha(lxname[len]))
@@ -1391,7 +1391,6 @@
        unit = (int)strtoul(lxname + len, &ep, 10);
        if (ep == NULL || ep == lxname + len || ep >= lxname +
LINUX_IFNAMSIZ)
                return (NULL);
-       index = 0;
        is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0;
        TAILQ_FOREACH(ifp, &ifnet, if_link) {
                /*
@@ -1402,7 +1401,7 @@
                if (ifp->if_unit == unit && ifp->if_name[len] == '\0'
&&
                    strncmp(ifp->if_name, lxname, len) == 0)
                        break;
-               if (is_eth && IFP_IS_ETH(ifp) && unit == index++)
+               if (is_eth && IFP_IS_ETH(ifp) && unit == ifp->if_index)
                        break;
        }
        if (ifp != NULL)



Cheers,

Andrew.


=====
+--
| Andrew Atrens                                                  |
| All opinions expressed are my own,  not those of any employer. |
+--                                                            --+

______________________________________________________ 
Send your holiday cheer with http://greetings.yahoo.ca
--0-864342549-1010379100=:13168
Content-Type: text/x-diff; name="linux_ioctl.c.diff"
Content-Description: linux_ioctl.c.diff
Content-Disposition: inline; filename="linux_ioctl.c.diff"

--- linux_ioctl.c.orig	Sun Jan  6 21:40:10 2002
+++ linux_ioctl.c	Sun Jan  6 21:40:45 2002
@@ -1381,7 +1381,7 @@
 	struct ifnet *ifp;
 	int len, unit;
 	char *ep;
-	int is_eth, index;
+	int is_eth;
 
 	for (len = 0; len < LINUX_IFNAMSIZ; ++len)
 		if (!isalpha(lxname[len]))
@@ -1391,7 +1391,6 @@
 	unit = (int)strtoul(lxname + len, &ep, 10);
 	if (ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ)
 		return (NULL);
-	index = 0;
 	is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0;
 	TAILQ_FOREACH(ifp, &ifnet, if_link) {
 		/*
@@ -1402,7 +1401,7 @@
 		if (ifp->if_unit == unit && ifp->if_name[len] == '\0' &&
 		    strncmp(ifp->if_name, lxname, len) == 0)
 			break;
-		if (is_eth && IFP_IS_ETH(ifp) && unit == index++)
+		if (is_eth && IFP_IS_ETH(ifp) && unit == ifp->if_index)
 			break;
 	}
 	if (ifp != NULL)

--0-864342549-1010379100=:13168--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020107045140.16097.qmail>