Date: Sun, 2 Dec 2001 22:44:48 -0800 From: Marcel Moolenaar <marcel@xcllnt.net> To: Glenn Johnson <gjohnson@srrc.ars.usda.gov> Cc: emulation@FreeBSD.ORG Subject: Re: SIOCGIFHWADDR ioctl fails [was: Re: problem with the new linux module] Message-ID: <20011202224448.A4448@dhcp01.pn.xcllnt.net> In-Reply-To: <20011202205417.A3522@dhcp01.pn.xcllnt.net> References: <20011130102101.A5245@node7.cluster.srrc.usda.gov> <20011202180007.A2618@dhcp01.pn.xcllnt.net> <20011203034308.GA643@gforce.johnson.home> <20011202205417.A3522@dhcp01.pn.xcllnt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Dec 02, 2001 at 08:54:17PM -0800, Marcel Moolenaar wrote: > > 692 lmutil CALL linux_ioctl(0x3,SIOCGIFHWADDR,0xbfbff614) > > 692 lmutil RET linux_ioctl -1 errno 22 Invalid argument > > 692 lmutil CALL close(0x3) > > 692 lmutil RET close 0 > > 692 lmutil CALL write(0x1,0x280ad000,0x29) > > 692 lmutil GIO fd 1 wrote 41 bytes > > "The FLEXlm host ID of this machine is "" > > " > > 692 lmutil RET write 41/0x29 Can you try the attached patch. Note that the patch is against -current. If it doesn't apply cleanly to -stable, let me know. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ioctl.diff" Index: linux_ioctl.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linux/linux_ioctl.c,v retrieving revision 1.76 diff -u -r1.76 linux_ioctl.c --- linux_ioctl.c 19 Nov 2001 15:43:45 -0000 1.76 +++ linux_ioctl.c 3 Dec 2001 06:17:55 -0000 @@ -1793,6 +1793,7 @@ struct ifnet *ifp; int len, unit; char *ep; + int is_eth, index; for (len = 0; len < LINUX_IFNAMSIZ; ++len) if (!isalpha(lxname[len])) @@ -1802,13 +1803,18 @@ 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) { - /* allow Linux programs to use FreeBSD names */ + /* + * Allow Linux programs to use FreeBSD names. Don't presume + * we never have an interface named "eth", so don't make + * the test optional based on is_eth. + */ if (ifp->if_unit == unit && ifp->if_name[len] == '\0' && strncmp(ifp->if_name, lxname, len) == 0) break; - if (ifp->if_index == unit && IFP_IS_ETH(ifp) && - strncmp(lxname, "eth", len) == 0) + if (is_eth && IFP_IS_ETH(ifp) && unit == index++) break; } if (ifp != NULL) --/9DWx/yDrRhgMJTb-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011202224448.A4448>