fix ether-wake, avoid ether_hostton and include if_ether

Patch by Tias Guns <tias@ulyssis.org>, based on 'no-ether_hostton' by Dan Drown
"there is no /etc/ethers or ether_hostton on bionic"
http://dan.drown.org/android/src/busybox/
Rebased for busybox 1.24.1 by Chris Renshaw <osm0sis@outlook.com>
This commit is contained in:
Chris Renshaw 2015-12-02 23:44:06 -04:00 committed by topjohnwu
parent b454f64305
commit fa9b786d8c

View File

@ -87,6 +87,7 @@
#include "libbb.h"
#include <netpacket/packet.h>
#include <netinet/ether.h>
#include <netinet/if_ether.h>
#include <linux/if.h>
/* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to
@ -132,7 +133,7 @@ static void get_dest_addr(const char *hostid, struct ether_addr *eaddr)
eap = ether_aton_r(hostid, eaddr);
if (eap) {
bb_debug_msg("The target station address is %s\n\n", ether_ntoa_r(eap, ether_buf));
#if !defined(__UCLIBC__) || UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 30)
#if !defined(__BIONIC__) && (!defined(__UCLIBC__) || UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 30))
} else if (ether_hostton(hostid, eaddr) == 0) {
bb_debug_msg("Station address for hostname %s is %s\n\n", hostid, ether_ntoa_r(eaddr, ether_buf));
#endif