提交 c11fdfae 编写于 作者: S Sven Eckelmann 提交者: Antonio Quartulli

batman-adv: Prefix types defines with BATADV_

Reported-by: NMartin Hundebøll <martin@hundeboll.net>
Signed-off-by: NSven Eckelmann <sven@narfation.org>
上级 7e071c79
...@@ -196,7 +196,8 @@ int batadv_hardif_min_mtu(struct net_device *soft_iface) ...@@ -196,7 +196,8 @@ int batadv_hardif_min_mtu(struct net_device *soft_iface)
if (hard_iface->soft_iface != soft_iface) if (hard_iface->soft_iface != soft_iface)
continue; continue;
min_mtu = min_t(int, hard_iface->net_dev->mtu - BAT_HEADER_LEN, min_mtu = min_t(int,
hard_iface->net_dev->mtu - BATADV_HEADER_LEN,
min_mtu); min_mtu);
} }
rcu_read_unlock(); rcu_read_unlock();
...@@ -320,18 +321,18 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface, ...@@ -320,18 +321,18 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
hard_iface->net_dev->name); hard_iface->net_dev->name);
if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu < if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
ETH_DATA_LEN + BAT_HEADER_LEN) ETH_DATA_LEN + BATADV_HEADER_LEN)
batadv_info(hard_iface->soft_iface, batadv_info(hard_iface->soft_iface,
"The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %zi would solve the problem.\n", "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %zi would solve the problem.\n",
hard_iface->net_dev->name, hard_iface->net_dev->mtu, hard_iface->net_dev->name, hard_iface->net_dev->mtu,
ETH_DATA_LEN + BAT_HEADER_LEN); ETH_DATA_LEN + BATADV_HEADER_LEN);
if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu < if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
ETH_DATA_LEN + BAT_HEADER_LEN) ETH_DATA_LEN + BATADV_HEADER_LEN)
batadv_info(hard_iface->soft_iface, batadv_info(hard_iface->soft_iface,
"The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %zi.\n", "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %zi.\n",
hard_iface->net_dev->name, hard_iface->net_dev->mtu, hard_iface->net_dev->name, hard_iface->net_dev->mtu,
ETH_DATA_LEN + BAT_HEADER_LEN); ETH_DATA_LEN + BATADV_HEADER_LEN);
if (batadv_hardif_is_iface_up(hard_iface)) if (batadv_hardif_is_iface_up(hard_iface))
batadv_hardif_activate_interface(hard_iface); batadv_hardif_activate_interface(hard_iface);
......
...@@ -351,7 +351,7 @@ static void batadv_interface_setup(struct net_device *dev) ...@@ -351,7 +351,7 @@ static void batadv_interface_setup(struct net_device *dev)
*/ */
dev->mtu = ETH_DATA_LEN; dev->mtu = ETH_DATA_LEN;
/* reserve more space in the skbuff for our header */ /* reserve more space in the skbuff for our header */
dev->hard_header_len = BAT_HEADER_LEN; dev->hard_header_len = BATADV_HEADER_LEN;
/* generate random address */ /* generate random address */
eth_hw_addr_random(dev); eth_hw_addr_random(dev);
......
...@@ -22,12 +22,11 @@ ...@@ -22,12 +22,11 @@
#include "packet.h" #include "packet.h"
#include "bitarray.h" #include "bitarray.h"
#include <linux/kernel.h>
#define BAT_HEADER_LEN (ETH_HLEN + \ #define BATADV_HEADER_LEN \
((sizeof(struct unicast_packet) > sizeof(struct bcast_packet) ? \ (ETH_HLEN + max(sizeof(struct unicast_packet), \
sizeof(struct unicast_packet) : \ sizeof(struct bcast_packet)))
sizeof(struct bcast_packet))))
struct hard_iface { struct hard_iface {
struct list_head list; struct list_head list;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册