From owner-freebsd-net@FreeBSD.ORG Thu Mar 24 23:11:38 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FC9016A4CE for ; Thu, 24 Mar 2005 23:11:38 +0000 (GMT) Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4F8843D3F for ; Thu, 24 Mar 2005 23:11:37 +0000 (GMT) (envelope-from pheerboth@apple.com) Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out4.apple.com (8.12.11/8.12.11) with ESMTP id j2ONBbCg013234 for ; Thu, 24 Mar 2005 15:11:37 -0800 (PST) Received: from relay1.apple.com (relay1.apple.com) by mailgate1.apple.com ; Thu, 24 Mar 2005 15:11:37 -0800 Received: from [17.206.50.106] (il0602f-dhcp106.apple.com [17.206.50.106]) by relay1.apple.com (8.12.11/8.12.11) with ESMTP id j2ONBYJu019020; Thu, 24 Mar 2005 15:11:34 -0800 (PST) In-Reply-To: <200503240358.j2O3wb4I099605@banyan.cs.ait.ac.th> References: <200503240339.j2O3dpoN099306@banyan.cs.ait.ac.th> <42423976.7000608@schluting.com> <200503240358.j2O3wb4I099605@banyan.cs.ait.ac.th> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <4d6157b283e8c2187a339c0a40d8eec3@apple.com> Content-Transfer-Encoding: 7bit From: Peter Heerboth Date: Thu, 24 Mar 2005 15:11:35 -0800 To: Olivier Nicole X-Mailer: Apple Mail (2.619.2) cc: freebsd-net@freebsd.org Subject: Re: Resolving MAC address X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2005 23:11:38 -0000 One thing you can try if you want to avoid needing super user privileges is to send a small UDP packet to the given IP, which will force the kernel to ARP for the address if it is not already present. Then you can check the routing table through sysctl() by passing in {CTL_NET, PF_ROUTE, 0, AF_INET,NET_RT_FLAGS,RTF_LLINFO} for the name parameter and searching through the route message list. All sending the UDP packet will do is force the kernel to arp, it doesn't actually matter if the other side is filtering or not. On Mar 23, 2005, at 7:58 PM, Olivier Nicole wrote: >>> ? (10.0.0.1) at 00:e0:29:ad:5a:aa on em0 [ethernet] >>> >>> will do the trick, but it is a bit too heavy for the purpose, I'd >>> prefer a solution that only send an ARP request. >>> >> >> If you just want to avoid the DNS lookup, you can use arp -an. >> Its much faster :) > > Thanks. Off course I use arp -n to avoid DNS resolution. > > But what i really want to avoid is sending any IP/ICMP packet when the > ARP resolution is all I need. (And some people even filter out the > ICMP echo request packets (Windows XP firewall), so I have to wait for > the time out). > > Olivier > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"