From d90524202c9484f2851dbe192847f71dadc22ce5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 26 Sep 2014 15:35:31 +0200 Subject: Move get_source_address and get_dest_address to fastd.h --- src/receive.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/receive.c') diff --git a/src/receive.c b/src/receive.c index e2a996b..0b6f5af 100644 --- a/src/receive.c +++ b/src/receive.c @@ -245,13 +245,6 @@ void fastd_receive(fastd_socket_t *sock) { handle_socket_receive(sock, &local_addr, &recvaddr, buffer); } -/** Returns the source address of an ethernet packet */ -static inline fastd_eth_addr_t get_source_address(const fastd_buffer_t buffer) { - fastd_eth_addr_t ret; - memcpy(&ret, buffer.data+offsetof(struct ethhdr, h_source), ETH_ALEN); - return ret; -} - /** Handles a received and decrypted payload packet */ void fastd_handle_receive(fastd_peer_t *peer, fastd_buffer_t buffer, bool reordered) { if (conf.mode == MODE_TAP) { @@ -261,7 +254,7 @@ void fastd_handle_receive(fastd_peer_t *peer, fastd_buffer_t buffer, bool reorde return; } - fastd_eth_addr_t src_addr = get_source_address(buffer); + fastd_eth_addr_t src_addr = fastd_buffer_source_address(buffer); if (fastd_eth_addr_is_unicast(src_addr)) fastd_peer_eth_addr_add(peer, src_addr); -- cgit v1.2.3