summaryrefslogtreecommitdiffstats
path: root/src/receive.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-26 15:35:31 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-26 15:35:31 +0200
commitd90524202c9484f2851dbe192847f71dadc22ce5 (patch)
tree2a5413ef5b58ebb6121b67114ffa6863c6b6fbe6 /src/receive.c
parentc341adf527930b211bb10480826456b3f03dc066 (diff)
downloadfastd-d90524202c9484f2851dbe192847f71dadc22ce5.tar
fastd-d90524202c9484f2851dbe192847f71dadc22ce5.zip
Move get_source_address and get_dest_address to fastd.h
Diffstat (limited to 'src/receive.c')
-rw-r--r--src/receive.c9
1 files changed, 1 insertions, 8 deletions
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);