diff options
Diffstat (limited to 'net/tipc/bearer.h')
-rw-r--r-- | net/tipc/bearer.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 552185bc4773..5f11e18b1fa1 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
@@ -39,6 +39,7 @@ | |||
39 | 39 | ||
40 | #include "netlink.h" | 40 | #include "netlink.h" |
41 | #include "core.h" | 41 | #include "core.h" |
42 | #include "msg.h" | ||
42 | #include <net/genetlink.h> | 43 | #include <net/genetlink.h> |
43 | 44 | ||
44 | #define MAX_MEDIA 3 | 45 | #define MAX_MEDIA 3 |
@@ -61,6 +62,9 @@ | |||
61 | #define TIPC_MEDIA_TYPE_IB 2 | 62 | #define TIPC_MEDIA_TYPE_IB 2 |
62 | #define TIPC_MEDIA_TYPE_UDP 3 | 63 | #define TIPC_MEDIA_TYPE_UDP 3 |
63 | 64 | ||
65 | /* minimum bearer MTU */ | ||
66 | #define TIPC_MIN_BEARER_MTU (MAX_H_SIZE + INT_H_SIZE) | ||
67 | |||
64 | /** | 68 | /** |
65 | * struct tipc_node_map - set of node identifiers | 69 | * struct tipc_node_map - set of node identifiers |
66 | * @count: # of nodes in set | 70 | * @count: # of nodes in set |
@@ -226,4 +230,13 @@ void tipc_bearer_xmit(struct net *net, u32 bearer_id, | |||
226 | void tipc_bearer_bc_xmit(struct net *net, u32 bearer_id, | 230 | void tipc_bearer_bc_xmit(struct net *net, u32 bearer_id, |
227 | struct sk_buff_head *xmitq); | 231 | struct sk_buff_head *xmitq); |
228 | 232 | ||
233 | /* check if device MTU is too low for tipc headers */ | ||
234 | static inline bool tipc_mtu_bad(struct net_device *dev, unsigned int reserve) | ||
235 | { | ||
236 | if (dev->mtu >= TIPC_MIN_BEARER_MTU + reserve) | ||
237 | return false; | ||
238 | netdev_warn(dev, "MTU too low for tipc bearer\n"); | ||
239 | return true; | ||
240 | } | ||
241 | |||
229 | #endif /* _TIPC_BEARER_H */ | 242 | #endif /* _TIPC_BEARER_H */ |