summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fastd.h2
-rw-r--r--src/handshake.c1
-rw-r--r--src/peer.h1
3 files changed, 3 insertions, 1 deletions
diff --git a/src/fastd.h b/src/fastd.h
index ee48a65..a16244a 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -159,7 +159,7 @@ struct fastd_iface {
fastd_poll_fd_t fd; /**< The file descriptor of the tunnel interface */
char *name; /**< The interface name */
fastd_peer_t *peer; /**< The peer associated with the interface (if any) */
- uint16_t mtu;
+ uint16_t mtu; /**< The MTU of the interface */
};
diff --git a/src/handshake.c b/src/handshake.c
index 000d685..d82a4b2 100644
--- a/src/handshake.c
+++ b/src/handshake.c
@@ -398,6 +398,7 @@ static inline bool check_records(fastd_socket_t *sock, const fastd_peer_address_
return true;
}
+/** Checks if an MTU record of a handshake matches the configured MTU for a peer */
bool fastd_handshake_check_mtu(fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, const fastd_handshake_t *handshake) {
if (handshake->records[RECORD_MTU].length == 2) {
if (as_uint16_endian(&handshake->records[RECORD_MTU], handshake->little_endian) != fastd_peer_get_mtu(peer)) {
diff --git a/src/peer.h b/src/peer.h
index 948bbc6..ea1b950 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -284,6 +284,7 @@ static inline const fastd_string_stack_t * fastd_peer_get_methods(const fastd_pe
return NULL;
}
+/** Returns the MTU to use for a peer */
static inline uint16_t fastd_peer_get_mtu(const fastd_peer_t *peer) {
if (conf.mode == MODE_TAP)
return conf.mtu;