From owner-freebsd-stable Sun Jan 6 20:51:48 2002 Delivered-To: freebsd-stable@freebsd.org Received: from web11305.mail.yahoo.com (web11305.mail.yahoo.com [216.136.131.208]) by hub.freebsd.org (Postfix) with SMTP id D18B337B416 for ; Sun, 6 Jan 2002 20:51:40 -0800 (PST) Message-ID: <20020107045140.16097.qmail@web11305.mail.yahoo.com> Received: from [47.248.0.42] by web11305.mail.yahoo.com via HTTP; Sun, 06 Jan 2002 23:51:40 EST Date: Sun, 6 Jan 2002 23:51:40 -0500 (EST) From: Andrew Atrens Subject: small fix for sys/compat/linux/linux_ioctl.c To: marcel@freebsd.org, stable@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-864342549-1010379100=:13168" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --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