From 9ac7f3588dda7d175e04878e7b871a88306d13bf Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 25 Jun 2015 01:03:23 +0200 Subject: Don't depend on net/if_ether.h Instead of adding compatiblity code to make this work with musl, just duplicate the needed definitions in fastd. --- src/peer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/peer.c') diff --git a/src/peer.c b/src/peer.c index b174b9b..363bdd7 100644 --- a/src/peer.c +++ b/src/peer.c @@ -34,13 +34,14 @@ #include "poll.h" #include +#include #include /** Adds peer-specific fields to \e env */ void fastd_peer_set_shell_env(fastd_shell_env_t *env, const fastd_peer_t *peer, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *peer_addr) { - /* both INET6_ADDRSTRLEN and IFNAMESIZE already include space for the zero termination, so there is no need to add space for the '%' here. */ - char buf[INET6_ADDRSTRLEN+IF_NAMESIZE]; + /* both INET6_ADDRSTRLEN and IFNAMSIZ already include space for the zero termination, so there is no need to add space for the '%' here. */ + char buf[INET6_ADDRSTRLEN+IFNAMSIZ]; fastd_shell_env_set(env, "PEER_NAME", peer ? peer->name : NULL); @@ -890,7 +891,7 @@ bool fastd_peer_set_established(fastd_peer_t *peer) { /** Compares two MAC addresses */ static inline int eth_addr_cmp(const fastd_eth_addr_t *addr1, const fastd_eth_addr_t *addr2) { - return memcmp(addr1->data, addr2->data, ETH_ALEN); + return memcmp(addr1->data, addr2->data, sizeof(fastd_eth_addr_t)); } /** Compares two fastd_peer_eth_addr_t entries by their MAC addresses */ -- cgit v1.2.3