From owner-freebsd-net@FreeBSD.ORG Tue Feb 2 03:20:10 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C175D106566B for ; Tue, 2 Feb 2010 03:20:10 +0000 (UTC) (envelope-from cowens@greatbaysoftware.com) Received: from portcityhosting.com (bayringfw.portcityweb.com [64.140.243.92]) by mx1.freebsd.org (Postfix) with ESMTP id 72F348FC17 for ; Tue, 2 Feb 2010 03:20:09 +0000 (UTC) Received: from [127.0.0.1] ([173.14.128.81]) by portcityhosting.com with MailEnable ESMTP; Mon, 1 Feb 2010 22:20:06 -0500 X-WatchGuard-Mail-Exception: Allow Message-ID: <4B679AED.9040308@greatbaysoftware.com> Date: Mon, 01 Feb 2010 22:24:29 -0500 From: Charles Owens MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-WatchGuard-AntiVirus: part scanned. clean action=allow X-ME-Bayesian: 0.000000 Subject: libnet_get_hwaddr() failing with FreeBSD 8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2010 03:20:10 -0000 Hello, I'm working with some code (snippet below) that fails with libnet_get_hwaddr() function (it returns false). The code works fine under 7.x but not with 8.0 . Any thoughts as to what might be going on? Thanks much, Charles int get_hw_addr(char *device, u_char mac[6]) { struct libnet_ether_addr *mac_address; libnet_t *ln; char err_buf[LIBNET_ERRBUF_SIZE]; ln = libnet_init(LIBNET_LINK, device, err_buf); if (!ln) { fprintf(stderr, "libnet_open_link_interface: %s\n", err_buf); return -1; } mac_address = libnet_get_hwaddr(ln); if (!mac_address) { fprintf(stderr, "libnet_get_hwaddr: %s\n", err_buf); return -1; } memcpy(mac, mac_address->ether_addr_octet, 6); return 0; } -- Charles Owens Great Bay Software, Inc.