From owner-svn-ports-all@freebsd.org Mon Jan 22 01:54:26 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95B3FEC7C44; Mon, 22 Jan 2018 01:54:26 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70C6223ED; Mon, 22 Jan 2018 01:54:26 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B25B313CC9; Mon, 22 Jan 2018 01:54:25 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0M1sPxg062381; Mon, 22 Jan 2018 01:54:25 GMT (envelope-from ler@FreeBSD.org) Received: (from ler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0M1sPLN062380; Mon, 22 Jan 2018 01:54:25 GMT (envelope-from ler@FreeBSD.org) Message-Id: <201801220154.w0M1sPLN062380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ler set sender to ler@FreeBSD.org using -f From: Larry Rosenman Date: Mon, 22 Jan 2018 01:54:25 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r459634 - head/net/boinc-client/files X-SVN-Group: ports-head X-SVN-Commit-Author: ler X-SVN-Commit-Paths: head/net/boinc-client/files X-SVN-Commit-Revision: 459634 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2018 01:54:26 -0000 Author: ler Date: Mon Jan 22 01:54:25 2018 New Revision: 459634 URL: https://svnweb.freebsd.org/changeset/ports/459634 Log: net/boinc-client: actually get the real MAC address Modified: head/net/boinc-client/files/patch-client_mac__address.cpp Modified: head/net/boinc-client/files/patch-client_mac__address.cpp ============================================================================== --- head/net/boinc-client/files/patch-client_mac__address.cpp Mon Jan 22 01:11:55 2018 (r459633) +++ head/net/boinc-client/files/patch-client_mac__address.cpp Mon Jan 22 01:54:25 2018 (r459634) @@ -1,12 +1,46 @@ ---- client/mac_address.cpp.orig 2018-01-21 22:41:16 UTC +--- client/mac_address.cpp.orig 2018-01-14 10:07:52 UTC +++ client/mac_address.cpp -@@ -262,6 +262,9 @@ int get_mac_address(char* address) { +@@ -67,6 +67,10 @@ + #ifdef HAVE_NETINET_ETHER_H + #include + #endif ++#if defined(__FreeBSD__) ++#include ++#include ++#endif + + #include "mac_address.h" + +@@ -262,10 +266,32 @@ int get_mac_address(char* address) { return -1; } hw_addr = (struct ether_addr *)&(item->lifr_lifru.lifru_enaddr); ++#elif defined(__FreeBSD__) ++ struct ifaddrs *ifap, *ifaptr; ++ unsigned char *ptr; ++ ++ if (getifaddrs(&ifap) == 0) { ++ for(ifaptr = ifap; ifaptr != NULL; ifaptr = (ifaptr)->ifa_next) { ++ if (!strcmp((ifaptr)->ifa_name, item->ifr_name) && (((ifaptr)->ifa_addr)->sa_family == AF_LINK)) { ++ ptr = (unsigned char *)LLADDR((struct sockaddr_dl *)(ifaptr)->ifa_addr); ++ hw_addr = (struct ether_addr *)ptr; ++ break; ++ } ++ } ++ } else { ++ return -1; ++ } +#else -+ /* Need to teach this how on FreeBSD, but for now don't crash */ + return -1; #endif strcpy(address, ether_ntoa(hw_addr)); ++#if defined(__FreeBSD__) ++ freeifaddrs(ifap); ++#endif #ifdef HAVE_STRUCT_LIFCONF + if (strstr(item->lifr_name, "eth")) break; ++#elif defined(__FreeBSD__) ++ break; + #else + if (strstr(item->ifr_name, "eth")) break; + #endif