From owner-freebsd-bugs Fri Dec 6 1:30: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34F4537B401 for ; Fri, 6 Dec 2002 01:30:04 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0E5843E9C for ; Fri, 6 Dec 2002 01:30:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gB69U2x3038779 for ; Fri, 6 Dec 2002 01:30:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gB69U2Qm038778; Fri, 6 Dec 2002 01:30:02 -0800 (PST) Date: Fri, 6 Dec 2002 01:30:02 -0800 (PST) Message-Id: <200212060930.gB69U2Qm038778@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Dmitry Frolov Subject: Re: kern/42120: arp(8) fails due to ioctl SIOCGIFNETMASK failure Reply-To: Dmitry Frolov Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/42120; it has been noted by GNATS. From: Dmitry Frolov 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 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