Date: Fri, 6 Dec 2002 01:30:02 -0800 (PST) From: Dmitry Frolov <frolov@riss-telecom.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/42120: arp(8) fails due to ioctl SIOCGIFNETMASK failure Message-ID: <200212060930.gB69U2Qm038778@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/42120; it has been noted by GNATS. From: Dmitry Frolov <frolov@riss-telecom.ru> To: freebsd-gnats-submit@FreeBSD.org, eugen@www.svzserv.kemerovo.su Cc: Subject: Re: kern/42120: arp(8) fails due to ioctl SIOCGIFNETMASK failure Date: Fri, 6 Dec 2002 15:23:07 +0600 We experienced same behavior from arp(8). Workaround was to use route(8) with -proxy option. However we made a fix: according to sys/netinet/in.c (see in_control() function) we should set alias address in SIOCGIFNETMASK ifreq to get correct netmask for that address. Here is the patch (made for 4.6-R, but code in -current still the same): --- usr.sbin/arp/arp.c.orig Thu Jul 11 16:24:31 2002 +++ usr.sbin/arp/arp.c Thu Jul 11 16:24:17 2002 @@ -703,6 +703,8 @@ * Get its netmask and check that it's on * the right subnet. */ + ((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr.s_addr = + ina; if (ioctl(sock, SIOCGIFNETMASK, &ifreq) < 0) continue; mask = ((struct sockaddr_in *) Also note that it's not a kern but bin problem. -- Dmitry Frolov <frolov@riss-telecom.ru> RISS-Telecom Network, Novosibirsk, Russia 66415911@ICQ, +7 3832 NO WA1T, DVF-RIPE To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212060930.gB69U2Qm038778>