diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-06-25 01:03:23 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-06-25 01:03:23 +0200 |
commit | 9ac7f3588dda7d175e04878e7b871a88306d13bf (patch) | |
tree | 00846bf23da618f6fb43da1b24c8b877dd6df60f /src/peer.c | |
parent | fc5e06a19c090d98620a735e33b57aee7c43107d (diff) | |
download | fastd-9ac7f3588dda7d175e04878e7b871a88306d13bf.tar fastd-9ac7f3588dda7d175e04878e7b871a88306d13bf.zip |
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.
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -34,13 +34,14 @@ #include "poll.h" #include <arpa/inet.h> +#include <net/if.h> #include <sys/wait.h> /** 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 */ |