summaryrefslogtreecommitdiffstats
path: root/src/peer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/peer.h b/src/peer.h
index e77462c..948bbc6 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -73,6 +73,7 @@ struct fastd_peer {
fastd_protocol_peer_state_t *protocol_state; /**< Protocol-specific peer state */
char *ifname; /**< Peer-specific interface name */
+ uint16_t mtu; /**< Peer-specific interface MTU */
/* Starting here, more dynamic fields follow: */
@@ -283,6 +284,16 @@ static inline const fastd_string_stack_t * fastd_peer_get_methods(const fastd_pe
return NULL;
}
+static inline uint16_t fastd_peer_get_mtu(const fastd_peer_t *peer) {
+ if (conf.mode == MODE_TAP)
+ return conf.mtu;
+
+ if (peer && peer->mtu)
+ return peer->mtu;
+
+ return conf.mtu;
+}
+
/** Checks if a MAC address is a normal unicast address */
static inline bool fastd_eth_addr_is_unicast(fastd_eth_addr_t addr) {
return ((addr.data[0] & 1) == 0);